@mx-cartographer/experiences 9.4.61 → 9.4.63
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 +8 -0
- package/dist/core/stores/TrendsStore.d.ts +14 -0
- package/dist/core/stores/TrendsStore.es.js +43 -30
- package/dist/core/stores/TrendsStore.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.d.ts +17 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js +21 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/WithdrawalCard.d.ts +25 -0
- package/dist/insights-v2/components/WithdrawalCard.es.js +63 -0
- package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -0
- package/dist/insights-v2/index.d.ts +1 -0
- package/dist/insights-v2/index.es.js +62 -58
- package/dist/insights-v2/mappings/blocks.es.js +24 -22
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/trends/TrendsWidget.es.js +127 -122
- package/dist/trends/TrendsWidget.es.js.map +1 -1
- package/dist/trends/components/TrendsTableContainer.es.js +0 -2
- package/dist/trends/components/TrendsTableContainer.es.js.map +1 -1
- package/dist/trends/components/trendstable/TrendsTable.d.ts +1 -3
- package/dist/trends/components/trendstable/TrendsTable.es.js +29 -22
- package/dist/trends/components/trendstable/TrendsTable.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [9.4.63] - 10-07-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Trends Tabular View child category rows now open the filtered transaction drawer, matching the chart view MEW-4020
|
|
4
|
+
|
|
5
|
+
## [9.4.62] - 10-07-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - `withdrawal_block` (Highlight Withdrawal) component block and `WithdrawalCard`: the amount (shown with a leading minus unless it is zero), an `"{amount_label} {withdrawal_date}"` date line and a grey balance footer, read from one `instance_slot.data_series` row (`amount`, `amount_label`, `withdrawal_date`, `balance`, `balance_label`). Text arrives localized from the backend; only `amount` and `balance` are formatted. (WEC-1871)
|
|
8
|
+
|
|
1
9
|
## [9.4.61] - 10-07-2026
|
|
2
10
|
|
|
3
11
|
- **ADDED** - `ObservedUpdate` type exported from `GlobalStore` with an optional `staleBeatGuid`, so an in-app action that outdates a beat can tell the host to refetch it over the existing `onStoreUpdate` bridge; `transactions` is now optional on that payload (WEC-1852)
|
|
@@ -7,6 +7,20 @@ export declare class TrendsStore {
|
|
|
7
7
|
visibleListLength: number;
|
|
8
8
|
constructor(globalStore: GlobalStore);
|
|
9
9
|
setSelectedCategoryData: (data: DetailedCategoryWithTransactions | null) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a category guid — top level or sub-category — to the data the
|
|
12
|
+
* category details drawer renders.
|
|
13
|
+
*
|
|
14
|
+
* `detailedCategoriesWithTransactions` only holds top-level categories, and a
|
|
15
|
+
* sub-category carries `totalAmount: 0` / `totalMonthlyAmounts: []` so it is
|
|
16
|
+
* not double counted inside its parent. The drawer reads both fields, so a
|
|
17
|
+
* sub-category is rebuilt from its own range total and monthly series.
|
|
18
|
+
*
|
|
19
|
+
* The tabular view only routes sub-category guids here today; the top-level
|
|
20
|
+
* branch keeps this a complete resolver for any guid the drawer is given.
|
|
21
|
+
* @param guid - Guid of the category to resolve
|
|
22
|
+
*/
|
|
23
|
+
getCategoryWithTransactions: (guid: string) => DetailedCategoryWithTransactions | undefined;
|
|
10
24
|
setSelectedDateRange: (dateRange: DateRange) => void;
|
|
11
25
|
setVisibleListLength: (length: number) => void;
|
|
12
26
|
get sortedDetailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[];
|
|
@@ -1,47 +1,60 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { DATE_FORMATS_INTL as o, formatDate as r } from "../constants/DateFormats.es.js";
|
|
2
|
+
import { findDetailedSubCategory as d, getDetailedCategoryTransactions as c } from "../utils/CategoryUtil.es.js";
|
|
3
|
+
import { buildCategoryDetailsChartData as h, filterAndSortCategoriesWithTransactions as D } from "../utils/TrendsUtil.es.js";
|
|
4
|
+
import { endOfMonth as i } from "date-fns/endOfMonth";
|
|
5
|
+
import { isBefore as u } from "date-fns/isBefore";
|
|
6
|
+
import { subMonths as m } from "date-fns/subMonths";
|
|
7
|
+
import { differenceInCalendarMonths as C } from "date-fns/differenceInCalendarMonths";
|
|
8
|
+
import { makeAutoObservable as S } from "mobx";
|
|
9
|
+
import { addSeconds as b } from "date-fns/addSeconds";
|
|
10
|
+
var W = class {
|
|
10
11
|
globalStore;
|
|
11
12
|
selectedCategoryData = null;
|
|
12
13
|
selectedDateRange;
|
|
13
14
|
visibleListLength = 5;
|
|
14
|
-
constructor(
|
|
15
|
-
this.globalStore =
|
|
16
|
-
start:
|
|
17
|
-
end:
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
setSelectedCategoryData = (
|
|
21
|
-
this.selectedCategoryData =
|
|
15
|
+
constructor(t) {
|
|
16
|
+
this.globalStore = t, this.selectedDateRange = {
|
|
17
|
+
start: b(i(m(/* @__PURE__ */ new Date(), 6)), 1),
|
|
18
|
+
end: i(/* @__PURE__ */ new Date())
|
|
19
|
+
}, S(this);
|
|
20
|
+
}
|
|
21
|
+
setSelectedCategoryData = (t) => {
|
|
22
|
+
this.selectedCategoryData = t;
|
|
23
|
+
};
|
|
24
|
+
getCategoryWithTransactions = (t) => {
|
|
25
|
+
const { detailedCategories: e, detailedCategoriesWithTransactions: n } = this.globalStore.categoryStore, s = n.find((g) => g.guid === t);
|
|
26
|
+
if (s) return s;
|
|
27
|
+
const a = d(e, t);
|
|
28
|
+
if (!a) return;
|
|
29
|
+
const [l] = c([{
|
|
30
|
+
...a,
|
|
31
|
+
totalAmount: a.currentAmount,
|
|
32
|
+
totalMonthlyAmounts: a.monthlyAmounts
|
|
33
|
+
}], this.globalStore.transactionStore.sortedTransactions);
|
|
34
|
+
return l;
|
|
22
35
|
};
|
|
23
|
-
setSelectedDateRange = (
|
|
24
|
-
this.selectedDateRange =
|
|
36
|
+
setSelectedDateRange = (t) => {
|
|
37
|
+
this.selectedDateRange = t;
|
|
25
38
|
};
|
|
26
|
-
setVisibleListLength = (
|
|
27
|
-
this.visibleListLength =
|
|
39
|
+
setVisibleListLength = (t) => {
|
|
40
|
+
this.visibleListLength = t;
|
|
28
41
|
};
|
|
29
42
|
get sortedDetailedCategoriesWithTransactions() {
|
|
30
|
-
return
|
|
43
|
+
return D(this.globalStore.categoryStore.detailedCategoriesWithTransactions);
|
|
31
44
|
}
|
|
32
45
|
get isTransactionStoreIdle() {
|
|
33
|
-
const { isTransactionDataLoaded:
|
|
34
|
-
return
|
|
46
|
+
const { isTransactionDataLoaded: t, transactionsLoading: e } = this.globalStore.transactionStore;
|
|
47
|
+
return t && !e;
|
|
35
48
|
}
|
|
36
49
|
get isSelectedRangeLoaded() {
|
|
37
|
-
const { isTransactionDataLoaded:
|
|
38
|
-
return
|
|
50
|
+
const { isTransactionDataLoaded: t, cachedStartDate: e } = this.globalStore.transactionStore;
|
|
51
|
+
return t && !u(this.selectedDateRange.start, e);
|
|
39
52
|
}
|
|
40
53
|
get selectedDateRangeMonthCount() {
|
|
41
|
-
return
|
|
54
|
+
return C(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
42
55
|
}
|
|
43
56
|
get selectedDateRangeMonthRange() {
|
|
44
|
-
return `${
|
|
57
|
+
return `${r(this.selectedDateRange.start, o.MONTH_LONG)} - ${r(this.selectedDateRange.end, o.MONTH_LONG)}`;
|
|
45
58
|
}
|
|
46
59
|
get visibleCategories() {
|
|
47
60
|
return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
|
|
@@ -50,11 +63,11 @@ var R = class {
|
|
|
50
63
|
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
51
64
|
}
|
|
52
65
|
get categoryDetailsChartData() {
|
|
53
|
-
return
|
|
66
|
+
return h(this.selectedCategoryData, this.selectedDateRangeMonthCount);
|
|
54
67
|
}
|
|
55
68
|
};
|
|
56
69
|
export {
|
|
57
|
-
|
|
70
|
+
W as TrendsStore
|
|
58
71
|
};
|
|
59
72
|
|
|
60
73
|
//# sourceMappingURL=TrendsStore.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrendsStore.es.js","names":[],"sources":["../../../src/core/stores/TrendsStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { subMonths } from 'date-fns/subMonths'\n\nimport type { DateRange, DetailedCategoryWithTransactions } from '../types'\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\nimport {\n buildCategoryDetailsChartData,\n filterAndSortCategoriesWithTransactions,\n} from '../utils/TrendsUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class TrendsStore {\n globalStore: GlobalStore\n selectedCategoryData: DetailedCategoryWithTransactions | null = null\n selectedDateRange: DateRange\n visibleListLength: number = 5\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.selectedDateRange = {\n start: addSeconds(endOfMonth(subMonths(new Date(), 6)), 1),\n end: endOfMonth(new Date()),\n }\n makeAutoObservable(this)\n }\n\n setSelectedCategoryData = (data: DetailedCategoryWithTransactions | null) => {\n this.selectedCategoryData = data\n }\n\n setSelectedDateRange = (dateRange: DateRange) => {\n this.selectedDateRange = dateRange\n }\n\n setVisibleListLength = (length: number) => {\n this.visibleListLength = length\n }\n\n get sortedDetailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[] {\n return filterAndSortCategoriesWithTransactions(\n this.globalStore.categoryStore.detailedCategoriesWithTransactions,\n )\n }\n\n get isTransactionStoreIdle(): boolean {\n const { isTransactionDataLoaded, transactionsLoading } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !transactionsLoading\n }\n\n get isSelectedRangeLoaded(): boolean {\n const { isTransactionDataLoaded, cachedStartDate } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !isBefore(this.selectedDateRange.start, cachedStartDate)\n }\n\n get selectedDateRangeMonthCount(): number {\n return differenceInCalendarMonths(this.selectedDateRange.end, this.selectedDateRange.start) + 1\n }\n\n get selectedDateRangeMonthRange(): string {\n const startMonth = formatDate(this.selectedDateRange.start, DATE_FORMATS_INTL.MONTH_LONG)\n const endMonth = formatDate(this.selectedDateRange.end, DATE_FORMATS_INTL.MONTH_LONG)\n return `${startMonth} - ${endMonth}`\n }\n\n get visibleCategories(): DetailedCategoryWithTransactions[] {\n return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength)\n }\n\n get collapsedCategories(): DetailedCategoryWithTransactions[] {\n return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength)\n }\n\n get categoryDetailsChartData() {\n return buildCategoryDetailsChartData(\n this.selectedCategoryData,\n this.selectedDateRangeMonthCount,\n )\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TrendsStore.es.js","names":[],"sources":["../../../src/core/stores/TrendsStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { subMonths } from 'date-fns/subMonths'\n\nimport type { DateRange, DetailedCategoryWithTransactions } from '../types'\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\nimport {\n buildCategoryDetailsChartData,\n filterAndSortCategoriesWithTransactions,\n} from '../utils/TrendsUtil'\nimport { findDetailedSubCategory, getDetailedCategoryTransactions } from '../utils/CategoryUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class TrendsStore {\n globalStore: GlobalStore\n selectedCategoryData: DetailedCategoryWithTransactions | null = null\n selectedDateRange: DateRange\n visibleListLength: number = 5\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.selectedDateRange = {\n start: addSeconds(endOfMonth(subMonths(new Date(), 6)), 1),\n end: endOfMonth(new Date()),\n }\n makeAutoObservable(this)\n }\n\n setSelectedCategoryData = (data: DetailedCategoryWithTransactions | null) => {\n this.selectedCategoryData = data\n }\n\n /**\n * Resolve a category guid — top level or sub-category — to the data the\n * category details drawer renders.\n *\n * `detailedCategoriesWithTransactions` only holds top-level categories, and a\n * sub-category carries `totalAmount: 0` / `totalMonthlyAmounts: []` so it is\n * not double counted inside its parent. The drawer reads both fields, so a\n * sub-category is rebuilt from its own range total and monthly series.\n *\n * The tabular view only routes sub-category guids here today; the top-level\n * branch keeps this a complete resolver for any guid the drawer is given.\n * @param guid - Guid of the category to resolve\n */\n getCategoryWithTransactions = (guid: string): DetailedCategoryWithTransactions | undefined => {\n const { detailedCategories, detailedCategoriesWithTransactions } =\n this.globalStore.categoryStore\n\n const topLevelCategory = detailedCategoriesWithTransactions.find(\n (category) => category.guid === guid,\n )\n if (topLevelCategory) return topLevelCategory\n\n const subCategory = findDetailedSubCategory(detailedCategories, guid)\n if (!subCategory) return undefined\n\n const [subCategoryWithTransactions] = getDetailedCategoryTransactions(\n [\n {\n ...subCategory,\n totalAmount: subCategory.currentAmount,\n totalMonthlyAmounts: subCategory.monthlyAmounts,\n },\n ],\n this.globalStore.transactionStore.sortedTransactions,\n )\n\n return subCategoryWithTransactions\n }\n\n setSelectedDateRange = (dateRange: DateRange) => {\n this.selectedDateRange = dateRange\n }\n\n setVisibleListLength = (length: number) => {\n this.visibleListLength = length\n }\n\n get sortedDetailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[] {\n return filterAndSortCategoriesWithTransactions(\n this.globalStore.categoryStore.detailedCategoriesWithTransactions,\n )\n }\n\n get isTransactionStoreIdle(): boolean {\n const { isTransactionDataLoaded, transactionsLoading } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !transactionsLoading\n }\n\n get isSelectedRangeLoaded(): boolean {\n const { isTransactionDataLoaded, cachedStartDate } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !isBefore(this.selectedDateRange.start, cachedStartDate)\n }\n\n get selectedDateRangeMonthCount(): number {\n return differenceInCalendarMonths(this.selectedDateRange.end, this.selectedDateRange.start) + 1\n }\n\n get selectedDateRangeMonthRange(): string {\n const startMonth = formatDate(this.selectedDateRange.start, DATE_FORMATS_INTL.MONTH_LONG)\n const endMonth = formatDate(this.selectedDateRange.end, DATE_FORMATS_INTL.MONTH_LONG)\n return `${startMonth} - ${endMonth}`\n }\n\n get visibleCategories(): DetailedCategoryWithTransactions[] {\n return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength)\n }\n\n get collapsedCategories(): DetailedCategoryWithTransactions[] {\n return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength)\n }\n\n get categoryDetailsChartData() {\n return buildCategoryDetailsChartData(\n this.selectedCategoryData,\n this.selectedDateRangeMonthCount,\n )\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAa,IAAb,MAAyB;AAAA,EACvB;AAAA,EACA,uBAAgE;AAAA,EAChE;AAAA,EACA,oBAA4B;AAAA,EAE5B,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,oBAAoB;AAAA,MACvB,OAAO,EAAW,EAAW,EAAU,oBAAI,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC;AAAA,MACzD,KAAK,EAAW,oBAAI,KAAK,CAAC;AAAA,IAC5B,GACA,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,0BAAA,CAA2B,MAAkD;AAC3E,SAAK,uBAAuB;AAAA,EAC9B;AAAA,EAeA,8BAAA,CAA+B,MAA+D;AAC5F,UAAM,EAAE,oBAAA,GAAoB,oCAAA,EAAA,IAC1B,KAAK,YAAY,eAEb,IAAmB,EAAmC,KAAA,CACzD,MAAa,EAAS,SAAS,CAClC;AACA,QAAI,EAAkB,QAAO;AAE7B,UAAM,IAAc,EAAwB,GAAoB,CAAI;AACpE,QAAI,CAAC,EAAa;AAElB,UAAM,CAAC,CAAA,IAA+B,EACpC,CACE;AAAA,MACE,GAAG;AAAA,MACH,aAAa,EAAY;AAAA,MACzB,qBAAqB,EAAY;AAAA,IACnC,CACF,GACA,KAAK,YAAY,iBAAiB,kBACpC;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,uBAAA,CAAwB,MAAyB;AAC/C,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEA,uBAAA,CAAwB,MAAmB;AACzC,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEA,IAAI,2CAA+E;AACjF,WAAO,EACL,KAAK,YAAY,cAAc,kCACjC;AAAA,EACF;AAAA,EAEA,IAAI,yBAAkC;AACpC,UAAM,EAAE,yBAAA,GAAyB,qBAAA,EAAA,IAAwB,KAAK,YAAY;AAC1E,WAAO,KAA2B,CAAC;AAAA,EACrC;AAAA,EAEA,IAAI,wBAAiC;AACnC,UAAM,EAAE,yBAAA,GAAyB,iBAAA,EAAA,IAAoB,KAAK,YAAY;AACtE,WAAO,KAA2B,CAAC,EAAS,KAAK,kBAAkB,OAAO,CAAe;AAAA,EAC3F;AAAA,EAEA,IAAI,8BAAsC;AACxC,WAAO,EAA2B,KAAK,kBAAkB,KAAK,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAChG;AAAA,EAEA,IAAI,8BAAsC;AAGxC,WAAO,GAFY,EAAW,KAAK,kBAAkB,OAAO,EAAkB,UAEpE,CAAA,MADO,EAAW,KAAK,kBAAkB,KAAK,EAAkB,UAChD,CAAA;AAAA,EAC5B;AAAA,EAEA,IAAI,oBAAwD;AAC1D,WAAO,KAAK,yCAAyC,MAAM,GAAG,KAAK,iBAAiB;AAAA,EACtF;AAAA,EAEA,IAAI,sBAA0D;AAC5D,WAAO,KAAK,yCAAyC,MAAM,KAAK,iBAAiB;AAAA,EACnF;AAAA,EAEA,IAAI,2BAA2B;AAC7B,WAAO,EACL,KAAK,sBACL,KAAK,2BACP;AAAA,EACF;AACF"}
|
|
@@ -191,6 +191,7 @@ export declare const BlockType: {
|
|
|
191
191
|
readonly DoubleProgressBarBlock: "double_progress_bar_block";
|
|
192
192
|
readonly StepChartBlock: "step_chart_block";
|
|
193
193
|
readonly SVGImageBlock: "svg_image_block";
|
|
194
|
+
readonly WithdrawalBlock: "withdrawal_block";
|
|
194
195
|
};
|
|
195
196
|
export type BlockType = (typeof BlockType)[keyof typeof BlockType];
|
|
196
197
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BlockProps } from '../../types';
|
|
2
|
+
/** The Withdrawal row on `instance_slot.data_series`. */
|
|
3
|
+
export interface WithdrawalRow {
|
|
4
|
+
amount?: number;
|
|
5
|
+
amount_label?: string;
|
|
6
|
+
balance?: number;
|
|
7
|
+
balance_label?: string;
|
|
8
|
+
withdrawal_date?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The `withdrawal_block` (Highlight Withdrawal), reading one row on
|
|
12
|
+
* `instance_slot.data_series`. Text (`amount_label`, `withdrawal_date`,
|
|
13
|
+
* `balance_label`) renders as sent; `amount` and `balance` are numbers and are formatted by the
|
|
14
|
+
* card. Renders nothing unless the row carries both numbers.
|
|
15
|
+
*/
|
|
16
|
+
declare const WithdrawalBlock: ({ payload }: BlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export default WithdrawalBlock;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import l from "../../../components/WithdrawalCard.es.js";
|
|
2
|
+
import n from "@mui/material/Stack";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
var s = ({ payload: e }) => {
|
|
5
|
+
const r = e.instance_slot.data_series, [a] = Array.isArray(r) ? r : [];
|
|
6
|
+
return !Number.isFinite(a?.amount) || !Number.isFinite(a?.balance) ? null : /* @__PURE__ */ t(n, {
|
|
7
|
+
sx: { px: 16 },
|
|
8
|
+
children: /* @__PURE__ */ t(l, {
|
|
9
|
+
amount: a.amount,
|
|
10
|
+
amountLabel: a.amount_label,
|
|
11
|
+
balance: a.balance,
|
|
12
|
+
balanceLabel: a.balance_label,
|
|
13
|
+
withdrawalDate: a.withdrawal_date
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
s as default
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=WithdrawalBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport WithdrawalCard from '../../../components/WithdrawalCard'\nimport type { BlockProps } from '../../types'\n\n/** The Withdrawal row on `instance_slot.data_series`. */\nexport interface WithdrawalRow {\n amount?: number\n amount_label?: string\n balance?: number\n balance_label?: string\n withdrawal_date?: string\n}\n\n/**\n * The `withdrawal_block` (Highlight Withdrawal), reading one row on\n * `instance_slot.data_series`. Text (`amount_label`, `withdrawal_date`,\n * `balance_label`) renders as sent; `amount` and `balance` are numbers and are formatted by the\n * card. Renders nothing unless the row carries both numbers.\n */\nconst WithdrawalBlock = ({ payload }: BlockProps) => {\n const rows = payload.instance_slot.data_series\n const [row] = (Array.isArray(rows) ? rows : []) as WithdrawalRow[]\n\n if (!Number.isFinite(row?.amount) || !Number.isFinite(row?.balance)) return null\n\n return (\n <Stack sx={{ px: 16 }}>\n <WithdrawalCard\n amount={row.amount as number}\n amountLabel={row.amount_label}\n balance={row.balance as number}\n balanceLabel={row.balance_label}\n withdrawalDate={row.withdrawal_date}\n />\n </Stack>\n )\n}\n\nexport default WithdrawalBlock\n"],"mappings":";;;AAoBA,IAAM,IAAA,CAAmB,EAAE,SAAA,EAAA,MAA0B;AACnD,QAAM,IAAO,EAAQ,cAAc,aAC7B,CAAC,CAAA,IAAQ,MAAM,QAAQ,CAAI,IAAI,IAAO,CAAC;AAE7C,SAAI,CAAC,OAAO,SAAS,GAAK,MAAM,KAAK,CAAC,OAAO,SAAS,GAAK,OAAO,IAAU,OAG1E,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAClB,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ,EAAI;AAAA,MACZ,aAAa,EAAI;AAAA,MACjB,SAAS,EAAI;AAAA,MACb,cAAc,EAAI;AAAA,MAClB,gBAAgB,EAAI;AAAA,IACrB,CAAA;AAAA,EACI,CAAA;AAEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as WithdrawalBlock } from './WithdrawalBlock';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material/styles';
|
|
2
|
+
interface WithdrawalCardProps {
|
|
3
|
+
/** Withdrawn amount as a plain number (e.g. `100`); the card adds the minus sign. */
|
|
4
|
+
amount: number;
|
|
5
|
+
/** Pre-localized lead-in for the date line (e.g. "Withdrawn on"). */
|
|
6
|
+
amountLabel?: string;
|
|
7
|
+
/** Account balance after the withdrawal, shown in the grey footer row. */
|
|
8
|
+
balance: number;
|
|
9
|
+
/** Pre-localized footer label for the balance (e.g. "Balance"). */
|
|
10
|
+
balanceLabel?: string;
|
|
11
|
+
/** Pre-localized withdrawal date (e.g. "October 5, 2026"). */
|
|
12
|
+
withdrawalDate?: string;
|
|
13
|
+
sx?: SxProps;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A centered withdrawal highlight: the amount as a headline with a date line beneath it
|
|
17
|
+
* ("{amountLabel} {withdrawalDate}"), over a grey footer row showing the balance. All text arrives
|
|
18
|
+
* localized from the backend; only the two numbers are formatted here (the amount gets a leading
|
|
19
|
+
* minus unless it is zero). The date line is hidden when both `amountLabel` and `withdrawalDate`
|
|
20
|
+
* are empty.
|
|
21
|
+
*
|
|
22
|
+
* Figma: Withdrawal component block (Highlight Withdrawal). Scope is the Content section only.
|
|
23
|
+
*/
|
|
24
|
+
declare const WithdrawalCard: ({ amount, amountLabel, balance, balanceLabel, withdrawalDate, sx, }: WithdrawalCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default WithdrawalCard;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { formatCurrency as n } from "../../core/utils/NumberFormatting.es.js";
|
|
2
|
+
import t from "@mui/material/Stack";
|
|
3
|
+
import { Text as e } from "@mxenabled/mxui";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import m from "@mui/material/Divider";
|
|
6
|
+
var x = (o) => o === 0 ? n(0, "0,0.00") : `-${n(Math.abs(o), "0,0.00")}`, y = ({ amount: o, amountLabel: l, balance: s, balanceLabel: d, withdrawalDate: a, sx: p }) => {
|
|
7
|
+
const c = a ? [l, a].filter(Boolean).join(" ") : "";
|
|
8
|
+
return /* @__PURE__ */ i(t, {
|
|
9
|
+
sx: {
|
|
10
|
+
border: "1px solid",
|
|
11
|
+
borderColor: "divider",
|
|
12
|
+
borderRadius: "4px",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
width: "100%",
|
|
15
|
+
...p
|
|
16
|
+
},
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ i(t, {
|
|
19
|
+
sx: {
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
gap: 4,
|
|
22
|
+
px: 16,
|
|
23
|
+
py: 20
|
|
24
|
+
},
|
|
25
|
+
children: [/* @__PURE__ */ r(e, {
|
|
26
|
+
bold: !0,
|
|
27
|
+
variant: "h1",
|
|
28
|
+
children: x(o)
|
|
29
|
+
}), c && /* @__PURE__ */ r(e, {
|
|
30
|
+
color: "text.secondary",
|
|
31
|
+
variant: "caption",
|
|
32
|
+
children: c
|
|
33
|
+
})]
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ r(m, {}),
|
|
36
|
+
/* @__PURE__ */ i(t, {
|
|
37
|
+
sx: {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
bgcolor: "background.default",
|
|
40
|
+
flexDirection: "row",
|
|
41
|
+
justifyContent: "space-between",
|
|
42
|
+
minHeight: 40,
|
|
43
|
+
px: 16,
|
|
44
|
+
py: 2
|
|
45
|
+
},
|
|
46
|
+
children: [d && /* @__PURE__ */ r(e, {
|
|
47
|
+
color: "text.secondary",
|
|
48
|
+
variant: "caption",
|
|
49
|
+
children: d
|
|
50
|
+
}), /* @__PURE__ */ r(e, {
|
|
51
|
+
bold: !0,
|
|
52
|
+
variant: "body2",
|
|
53
|
+
children: n(s, "0,0.00")
|
|
54
|
+
})]
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
y as default
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=WithdrawalCard.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalCard.es.js","names":[],"sources":["../../../src/insights-v2/components/WithdrawalCard.tsx"],"sourcesContent":["import Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\n// A withdrawal is a debit, so a non-zero amount is shown with a leading minus (\"-$100.00\"); zero is\n// shown unsigned (\"$0.00\"). The sign comes from the magnitude, so an amount that already arrives\n// negative does not render a double minus.\nconst formatWithdrawalAmount = (amount: number) =>\n amount === 0 ? formatCurrency(0, '0,0.00') : `-${formatCurrency(Math.abs(amount), '0,0.00')}`\n\ninterface WithdrawalCardProps {\n /** Withdrawn amount as a plain number (e.g. `100`); the card adds the minus sign. */\n amount: number\n /** Pre-localized lead-in for the date line (e.g. \"Withdrawn on\"). */\n amountLabel?: string\n /** Account balance after the withdrawal, shown in the grey footer row. */\n balance: number\n /** Pre-localized footer label for the balance (e.g. \"Balance\"). */\n balanceLabel?: string\n /** Pre-localized withdrawal date (e.g. \"October 5, 2026\"). */\n withdrawalDate?: string\n sx?: SxProps\n}\n\n/**\n * A centered withdrawal highlight: the amount as a headline with a date line beneath it\n * (\"{amountLabel} {withdrawalDate}\"), over a grey footer row showing the balance. All text arrives\n * localized from the backend; only the two numbers are formatted here (the amount gets a leading\n * minus unless it is zero). The date line is hidden when both `amountLabel` and `withdrawalDate`\n * are empty.\n *\n * Figma: Withdrawal component block (Highlight Withdrawal). Scope is the Content section only.\n */\nconst WithdrawalCard = ({\n amount,\n amountLabel,\n balance,\n balanceLabel,\n withdrawalDate,\n sx,\n}: WithdrawalCardProps) => {\n const dateLine = withdrawalDate ? [amountLabel, withdrawalDate].filter(Boolean).join(' ') : ''\n\n return (\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '4px',\n overflow: 'hidden',\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', gap: 4, px: 16, py: 20 }}>\n <Text bold={true} variant=\"h1\">\n {formatWithdrawalAmount(amount)}\n </Text>\n {dateLine && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {dateLine}\n </Text>\n )}\n </Stack>\n <Divider />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.default',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 40,\n px: 16,\n py: 2,\n }}\n >\n {balanceLabel && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {balanceLabel}\n </Text>\n )}\n <Text bold={true} variant=\"body2\">\n {formatCurrency(balance, '0,0.00')}\n </Text>\n </Stack>\n </Stack>\n )\n}\n\nexport default WithdrawalCard\n"],"mappings":";;;;;AAWA,IAAM,IAAA,CAA0B,MAC9B,MAAW,IAAI,EAAe,GAAG,QAAQ,IAAI,IAAI,EAAe,KAAK,IAAI,CAAM,GAAG,QAAQ,CAAA,IAyBtF,IAAA,CAAkB,EACtB,QAAA,GACA,aAAA,GACA,SAAA,GACA,cAAA,GACA,gBAAA,GACA,IAAA,EAAA,MACyB;AACzB,QAAM,IAAW,IAAiB,CAAC,GAAa,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,IAAI;AAE5F,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAAA,IARF,UAAA;AAAA,MAUE,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,YAAY;AAAA,UAAU,KAAK;AAAA,UAAG,IAAI;AAAA,UAAI,IAAI;AAAA,QAAG;AAAA,QAA1D,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,SAAQ;AAAA,UACvB,UAAA,EAAuB,CAAM;AAAA,QAC1B,CAAA,GACL,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UAClC,UAAA;AAAA,QACG,CAAA,CAEH;AAAA;MACP,gBAAA,EAAC,GAAD,CAAU,CAAA;AAAA,MACV,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,eAAe;AAAA,UACf,gBAAgB;AAAA,UAChB,WAAW;AAAA,UACX,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QATF,UAAA,CAWG,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UAClC,UAAA;AAAA,QACG,CAAA,GAER,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,SAAQ;AAAA,UACvB,UAAA,EAAe,GAAS,QAAQ;AAAA,QAC7B,CAAA,CACD;AAAA;IACF;AAAA;AAEX"}
|
|
@@ -31,4 +31,5 @@ export { default as SavingsOpportunityCard } from './components/SavingsOpportuni
|
|
|
31
31
|
export { default as StatusPill } from './components/StatusPill';
|
|
32
32
|
export { default as SubscriptionHeroCard } from './components/SubscriptionHeroCard';
|
|
33
33
|
export { default as TransferLogoCard } from './components/TransferLogoCard';
|
|
34
|
+
export { default as WithdrawalCard } from './components/WithdrawalCard';
|
|
34
35
|
export { default as UpcomingBillCard, type UpcomingBillCardProps, type UpcomingBillDay, } from './components/UpcomingBillCard';
|
|
@@ -10,84 +10,88 @@ import h from "./components/CompactInsightCard.es.js";
|
|
|
10
10
|
import S from "./components/InsightErrorCard.es.js";
|
|
11
11
|
import { BAR_CHART_VARIANTS as b, barChartVariant as D, buildChartData as L, buildDataSeries as T } from "./blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
12
12
|
import { BarchartBlock as v } from "./blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
13
|
-
import { DoubleBarChartBlock as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import { DoubleBarChartBlock as E } from "./blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
14
|
+
import P from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
15
|
+
import M from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
16
|
+
import V from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
17
17
|
import y from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
18
18
|
import G from "./components/TransferLogoCard.es.js";
|
|
19
|
-
import
|
|
20
|
-
import { BudgetBlock as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
19
|
+
import _ from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
20
|
+
import { BudgetBlock as U } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
21
|
+
import q from "./components/SaveAnExtraCard.es.js";
|
|
22
|
+
import J from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
23
|
+
import Q from "./components/InsightTransactionRow.es.js";
|
|
24
24
|
import Y from "./components/TransactionListCard.es.js";
|
|
25
25
|
import { TransactionBlock as $, TransactionBlockVariant as rr } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
26
|
-
import
|
|
27
|
-
import ir from "./
|
|
28
|
-
import pr from "./
|
|
29
|
-
import er from "./components/
|
|
30
|
-
import
|
|
31
|
-
import lr from "./components/
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import Lr from "./components/
|
|
38
|
-
import Ir from "./components/
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import xr from "./components/
|
|
44
|
-
import Fr from "./components/
|
|
45
|
-
import
|
|
26
|
+
import mr from "./components/WithdrawalCard.es.js";
|
|
27
|
+
import ir from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
28
|
+
import { SVGImageBlock as pr } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
29
|
+
import er from "./components/AccountHeroCard.es.js";
|
|
30
|
+
import sr from "./components/AmountPill.es.js";
|
|
31
|
+
import lr from "./components/DesignateEmergencySavingsCard.es.js";
|
|
32
|
+
import { FeedbackBar as gr } from "./components/FeedbackBar.es.js";
|
|
33
|
+
import Br from "./components/FeedbackDialog.es.js";
|
|
34
|
+
import { DismissInsightDialog as hr } from "./components/DismissInsightDialog.es.js";
|
|
35
|
+
import { HiddenConfirmationCard as Sr } from "./components/HiddenConfirmationCard.es.js";
|
|
36
|
+
import { ErrorCard as br } from "./components/ErrorCard.es.js";
|
|
37
|
+
import { LoadingCard as Lr } from "./components/LoadingCard.es.js";
|
|
38
|
+
import { ObsolesceBanner as Ir } from "./components/ObsolesceBanner.es.js";
|
|
39
|
+
import wr from "./components/BaseLayout.es.js";
|
|
40
|
+
import Hr from "./components/StatusMessageCard.es.js";
|
|
41
|
+
import Rr from "./components/LogoTile.es.js";
|
|
42
|
+
import Or from "./components/LogoClusterCard.es.js";
|
|
43
|
+
import xr from "./components/MerchantHighlightCard.es.js";
|
|
44
|
+
import Fr from "./components/P2PLogoStack.es.js";
|
|
45
|
+
import Wr from "./components/SavingsOpportunityCard.es.js";
|
|
46
|
+
import Nr from "./components/SubscriptionHeroCard.es.js";
|
|
47
|
+
import jr from "./components/UpcomingBillCard.es.js";
|
|
46
48
|
export {
|
|
47
49
|
y as AccountBlock,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
er as AccountHeroCard,
|
|
51
|
+
_ as AccountSwitchBlock,
|
|
52
|
+
sr as AmountPill,
|
|
51
53
|
b as BAR_CHART_VARIANTS,
|
|
52
54
|
f as BadgedTile,
|
|
53
55
|
v as BarchartBlock,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
wr as BaseLayout,
|
|
57
|
+
U as BudgetBlock,
|
|
56
58
|
h as CompactInsightCard,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
lr as DesignateEmergencySavingsCard,
|
|
60
|
+
hr as DismissInsightDialog,
|
|
61
|
+
M as DonutChartBlock,
|
|
62
|
+
E as DoubleBarChartBlock,
|
|
63
|
+
V as DoubleProgressBarBlock,
|
|
64
|
+
br as ErrorCard,
|
|
65
|
+
gr as FeedbackBar,
|
|
66
|
+
Br as FeedbackDialog,
|
|
67
|
+
Sr as HiddenConfirmationCard,
|
|
66
68
|
S as InsightErrorCard,
|
|
67
69
|
c as InsightOptionsMenu,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
Q as InsightTransactionRow,
|
|
71
|
+
Lr as LoadingCard,
|
|
72
|
+
Or as LogoClusterCard,
|
|
71
73
|
d as LogoFromGuid,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
Rr as LogoTile,
|
|
75
|
+
xr as MerchantHighlightCard,
|
|
76
|
+
Ir as ObsolesceBanner,
|
|
75
77
|
n as OverflowMenu,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Fr as P2PLogoStack,
|
|
79
|
+
pr as SVGImageBlock,
|
|
80
|
+
q as SaveAnExtraCard,
|
|
81
|
+
J as SaveExtraBlock,
|
|
82
|
+
Wr as SavingsOpportunityCard,
|
|
81
83
|
B as StatusBadge,
|
|
82
|
-
|
|
84
|
+
Hr as StatusMessageCard,
|
|
83
85
|
o as StatusPill,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
P as StepChartBlock,
|
|
87
|
+
Nr as SubscriptionHeroCard,
|
|
86
88
|
$ as TransactionBlock,
|
|
87
89
|
rr as TransactionBlockVariant,
|
|
88
90
|
Y as TransactionListCard,
|
|
89
91
|
G as TransferLogoCard,
|
|
90
|
-
|
|
92
|
+
jr as UpcomingBillCard,
|
|
93
|
+
ir as WithdrawalBlock,
|
|
94
|
+
mr as WithdrawalCard,
|
|
91
95
|
D as barChartVariant,
|
|
92
96
|
L as buildChartData,
|
|
93
97
|
T as buildDataSeries,
|
|
@@ -10,42 +10,43 @@ import _ from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.e
|
|
|
10
10
|
import { BudgetBlock as k } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
11
11
|
import s from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
12
12
|
import { TransactionBlock as B } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
13
|
-
import C from "../blocks/
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
13
|
+
import C from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
14
|
+
import f from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
15
|
+
import { SVGImageBlock as u } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
16
|
+
import { PlaceholderActionBlock as T } from "../actionBlocks/PlaceholderActionBlock.es.js";
|
|
17
|
+
import { getMakeTransferDrawerTitle as b } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
18
|
+
import { MakeTransferActionBlockLayer as A } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
19
|
+
import { getDrawerHeaderTitle as O } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
20
|
+
import { TransactionDetailsBlock as h } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
21
|
+
import { useTransactionDetailsPrepare as d } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
21
22
|
import { TransactionHistoryBlock as L } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
22
23
|
var t = (e) => {
|
|
23
24
|
}, N = /* @__PURE__ */ new Set([
|
|
24
25
|
"",
|
|
25
26
|
"null",
|
|
26
27
|
"undefined"
|
|
27
|
-
]),
|
|
28
|
+
]), j = (e) => {
|
|
28
29
|
const r = e?.trim().toLowerCase();
|
|
29
30
|
return !!r && !N.has(r);
|
|
30
|
-
},
|
|
31
|
+
}, J = {
|
|
31
32
|
[o.PLACEHOLDER_ACTION_BLOCK]: {
|
|
32
|
-
Component:
|
|
33
|
+
Component: T,
|
|
33
34
|
usePrepare: t,
|
|
34
35
|
title: () => "Action Block Layer Drilldown"
|
|
35
36
|
},
|
|
36
37
|
[o.MAKE_TRANSFER_ACTION_BLOCK]: {
|
|
37
|
-
Component:
|
|
38
|
+
Component: A,
|
|
38
39
|
usePrepare: t,
|
|
39
|
-
title:
|
|
40
|
+
title: b
|
|
40
41
|
},
|
|
41
42
|
[o.TRANSCATION_HISTORY_ACTION_BLOCK]: {
|
|
42
43
|
Component: L,
|
|
43
44
|
usePrepare: t,
|
|
44
|
-
title:
|
|
45
|
+
title: O
|
|
45
46
|
},
|
|
46
47
|
[o.TRANSACTION_DETAILS_ACTION_BLOCK]: {
|
|
47
|
-
Component:
|
|
48
|
-
usePrepare:
|
|
48
|
+
Component: h,
|
|
49
|
+
usePrepare: d,
|
|
49
50
|
title: () => "Transaction Details"
|
|
50
51
|
},
|
|
51
52
|
[o.CONTACT_SUPPORT_ACTION_BLOCK]: {
|
|
@@ -53,7 +54,7 @@ var t = (e) => {
|
|
|
53
54
|
usePrepare: t,
|
|
54
55
|
title: (e, r) => r.help?.request_support ?? ""
|
|
55
56
|
}
|
|
56
|
-
},
|
|
57
|
+
}, Q = {
|
|
57
58
|
account_block: p,
|
|
58
59
|
account_switch_block: _,
|
|
59
60
|
bar_chart_block: c,
|
|
@@ -61,16 +62,17 @@ var t = (e) => {
|
|
|
61
62
|
donut_chart_block: m,
|
|
62
63
|
double_bar_chart_block: l,
|
|
63
64
|
double_progress_bar_block: n,
|
|
64
|
-
image_block:
|
|
65
|
+
image_block: f,
|
|
65
66
|
save_extra_block: s,
|
|
66
67
|
step_chart_block: i,
|
|
67
|
-
svg_image_block:
|
|
68
|
+
svg_image_block: u,
|
|
69
|
+
withdrawal_block: C,
|
|
68
70
|
transaction_block: B
|
|
69
71
|
};
|
|
70
72
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
J as actionBlocks,
|
|
74
|
+
Q as blocks,
|
|
75
|
+
j as hasDrawerBlock
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
//# sourceMappingURL=blocks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// A CTA opens a drawer only when it carries a real `block`. The backend may send\n// an empty/absent block (or the literal strings \"null\"/\"undefined\") for CTAs\n// that trigger something else (e.g. a postMessage) instead of a drilldown.\nconst NON_BLOCK_VALUES = new Set(['', 'null', 'undefined'])\nexport const hasDrawerBlock = (block?: string | null): boolean => {\n const normalized = block?.trim().toLowerCase()\n return !!normalized && !NON_BLOCK_VALUES.has(normalized)\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy (e.g.\n // MakeTransfer reads its variant title from layout.ts). Falls back to the CTA label.\n title?: (variant: string | null | undefined, copy: GlobalCopy) => string\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: {\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n },\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: {\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n },\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: {\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// A CTA opens a drawer only when it carries a real `block`. The backend may send\n// an empty/absent block (or the literal strings \"null\"/\"undefined\") for CTAs\n// that trigger something else (e.g. a postMessage) instead of a drilldown.\nconst NON_BLOCK_VALUES = new Set(['', 'null', 'undefined'])\nexport const hasDrawerBlock = (block?: string | null): boolean => {\n const normalized = block?.trim().toLowerCase()\n return !!normalized && !NON_BLOCK_VALUES.has(normalized)\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy (e.g.\n // MakeTransfer reads its variant title from layout.ts). Falls back to the CTA label.\n title?: (variant: string | null | undefined, copy: GlobalCopy) => string\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: {\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n },\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: {\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n },\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: {\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAKjC,IAAmB,oBAAI,IAAI;AAAA,EAAC;AAAA,EAAI;AAAA,EAAQ;AAAW,CAAC,GAC7C,IAAA,CAAkB,MAAmC;AAChE,QAAM,IAAa,GAAO,KAAK,EAAE,YAAY;AAC7C,SAAO,CAAC,CAAC,KAAc,CAAC,EAAiB,IAAI,CAAU;AACzD,GAgBa,IAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B;AAAA,IAC1C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EACC,CAAA,EAAgB,0BAAA,GAA6B;AAAA,IAC5C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EAGC,CAAA,EAAgB,4BAAA,GAA+B;AAAA,IAC9C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,MAAM,mBAAmB;AAAA,EAC3D;AACF,GAEa,IAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
|