@mx-cartographer/experiences 9.4.23 → 9.4.25
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 +15 -0
- package/dist/common/utils/PostMessage.d.ts +51 -0
- package/dist/common/utils/PostMessage.es.js +44 -11
- package/dist/common/utils/PostMessage.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -37
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +80 -71
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +5 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +61 -53
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.d.ts +3 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +28 -24
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +70 -63
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/SaveAnExtraCard.es.js +11 -11
- package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
- package/dist/insights-v2/components/SubHeader.es.js +4 -4
- package/dist/insights-v2/components/SubHeader.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [9.4.25] - 09-16-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Dismissible tip section in the `TransactionHistoryBlock` drawer's `bill_amount_not_standard` (`TRANSACTION`) drilldown variant: a shared `TipSection` component nudging the user to reach out to the merchant, dismissible via a new `onDismiss` handler and `tip_section_message`/`tip_section_title` copy keys (`insights_feed.general`) (WEC-1804)
|
|
4
|
+
- **ADDED** - `InsightsPayload.title` (`string`), per backend confirmation that the beat's display title is sent on the payload rather than read off the beat itself (WEC-1804)
|
|
5
|
+
- **CHANGED** - Renamed `InsightsPayload.subtitle` to `InsightsPayload.sub_title` to match what the backend actually sends, updating `BaseLayout`, `TransactionHistoryBlock`, and all related test/story/mock fixtures (WEC-1804)
|
|
6
|
+
- **CHANGED** - `BaseLayout` and `TransactionHistoryBlock`'s `bill_amount_not_standard` (`TRANSACTION`) drilldown header now read the beat's title/subtitle from `insights_payload.title`/`insights_payload.sub_title` instead of `beat.title`/`beat.html_title`; `DrillDownHeaderContext` (`TransactionHistoryBlock/layout.tsx`) updated from `{ htmlTitle, primaryTransaction }` to `{ title, subHeader }` to match (WEC-1804)
|
|
7
|
+
- **CHANGED** - `SubHeader`'s logo resolution now checks `merchant_guid` before `institution_guid` (previously institution took priority over merchant), with a TODO to have the backend send only the one relevant guid per beat instead of relying on check order (WEC-1804)
|
|
8
|
+
- **FIXED** - `TransactionHistoryBlock` and `BarchartBlock` now fall back to the generic "Monthly Amount"/"Trend" copy for the bar chart's legend labels when the backend doesn't send `legends` on `instance_slot_data`. `TransactionHistoryBlock`'s first attempt at this fallback was dead code (`array.map() ?? fallback` — `.map()` never returns `null`/`undefined`, so the `??` could never trigger); fixed to check `legends?.length` before mapping, and added regression tests for the empty-legends case in both blocks (WEC-1804)
|
|
9
|
+
- **FIXED** - `BarchartBlock` now waits on `GlobalUiStore.isCopyLoaded` (rendering `Loader` until then) before reading copy for its legend fallback, matching `TransactionHistoryBlock`'s pattern — `BaseLayout` renders block components without waiting for copy to load, so `BarchartBlock` could previously mount and crash (`Cannot read properties of undefined (reading 'general')`) before `GlobalCopyStore` finished loading (WEC-1804)
|
|
10
|
+
|
|
11
|
+
## [9.4.24] - 09-16-2026
|
|
12
|
+
|
|
13
|
+
- **ADDED** - insights-v2 beat CTA post message (ported from Pulse): when a beat CTA has no drilldown drawer `block`, clicking it now notifies the host via a `beat/cta` post message (payload `action`, `beat_guid`, `beat_template`, `action_string?`, `user_guid`) or, on a native mobile webview, navigates to a `scheme://pulse/<event>?metadata=...` URL. New helpers in `common/utils/PostMessage.ts` (`getBaseCtaPostMessage`, `sendBeatPostMessage`, `setWebviewURL`, `dispatchBeatCta`, `BEAT_CTA_EVENT`, `BEAT_OPERATION_1/2/3`); `BaseLayout` CTA buttons route through a `handleCtaClick` helper that opens the drawer for CTAs with a real block and otherwise dispatches the post message. Scoped to the Save an extra $100 beat's "Make a Transfer" CTA (WEC-1805)
|
|
14
|
+
- **CHANGED** - `SaveAnExtraCard` renders the projected-balance footer as-is (the backend now sends it pre-formatted, e.g. "$3,320") instead of re-formatting a parsed number; mock payload and `SaveExtraBlock`/card tests updated to match (WEC-1805)
|
|
15
|
+
|
|
1
16
|
## [9.4.23] - 09-16-2026
|
|
2
17
|
|
|
3
18
|
- **ADDED** - Nested-drawer support for the insights-v2 `TransactionHistoryBlock`: clicking a transaction row in the history drawer opens a second, stacked `TransactionDetailsBlock` drawer scoped to that transaction, via `InsightsV2Store.setActionContext({ transaction_guid })` and `useActionContext<DrilldownPayload>()`. `TransactionDrillDown`'s row click is forwarded through a new `onEachRowClick` prop (WEC-1699)
|
|
@@ -8,3 +8,54 @@ export interface PostMessageData {
|
|
|
8
8
|
export declare function postMessageToParent(message: PostMessageData): boolean;
|
|
9
9
|
export declare function postInsightOnTransaction(beatGuid: string): boolean;
|
|
10
10
|
export declare function postClientConfiguredCta(template: string): boolean;
|
|
11
|
+
export declare const BEAT_CTA_EVENT = "beat/cta";
|
|
12
|
+
export declare const BEAT_OPERATION_1 = "op_1";
|
|
13
|
+
export declare const BEAT_OPERATION_2 = "op_2";
|
|
14
|
+
export declare const BEAT_OPERATION_3 = "op_3";
|
|
15
|
+
/** Minimal beat shape needed to build a CTA post message. */
|
|
16
|
+
export interface BeatCtaSource {
|
|
17
|
+
guid: string;
|
|
18
|
+
template: string;
|
|
19
|
+
payload?: {
|
|
20
|
+
action_string?: string;
|
|
21
|
+
} | null;
|
|
22
|
+
}
|
|
23
|
+
export interface BeatCtaPayload {
|
|
24
|
+
action: string;
|
|
25
|
+
beat_guid: string;
|
|
26
|
+
beat_template: string;
|
|
27
|
+
action_string?: string;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build the `[event, payload]` tuple for a beat CTA post message.
|
|
32
|
+
* Mirrors Pulse's `getBaseCtaPostMessage`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getBaseCtaPostMessage(beat: BeatCtaSource, op?: string): [string, BeatCtaPayload];
|
|
35
|
+
/**
|
|
36
|
+
* Send a beat post message to the parent window. Only posts when embedded in an
|
|
37
|
+
* iframe (`window.self !== window.top`), mirroring Pulse's `sendPostMessage`
|
|
38
|
+
* (default scheme `mx/pulse`). Returns false when not embedded or no target.
|
|
39
|
+
*/
|
|
40
|
+
export declare function sendBeatPostMessage(event: string, data: Record<string, unknown>, scheme?: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Navigate a mobile webview to a custom-scheme URL instead of posting a message.
|
|
43
|
+
* Mirrors Pulse's `setWebviewURL` (default scheme `mx`).
|
|
44
|
+
*/
|
|
45
|
+
export declare function setWebviewURL(event: string, data?: Record<string, unknown>, scheme?: string): void;
|
|
46
|
+
export interface SendBeatCtaOptions {
|
|
47
|
+
/** True when running inside a native mobile webview. */
|
|
48
|
+
isMobileWebview?: boolean;
|
|
49
|
+
/** Custom URL scheme for webview navigation (from client config). */
|
|
50
|
+
webviewScheme?: string;
|
|
51
|
+
/** Current user guid, added to the metadata like the Pulse epic does. */
|
|
52
|
+
userGuid?: string;
|
|
53
|
+
/** Operation string sent with the CTA (defaults to op_1). */
|
|
54
|
+
op?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Send a beat CTA to the host: builds the payload, adds `user_guid`, then either
|
|
58
|
+
* posts a message to the host or navigates the webview. Mirrors the behaviour of
|
|
59
|
+
* Pulse's `postMessages` epic (minus the RxJS buffering).
|
|
60
|
+
*/
|
|
61
|
+
export declare function sendBeatCta(beat: BeatCtaSource, { isMobileWebview, webviewScheme, userGuid, op }?: SendBeatCtaOptions): void;
|
|
@@ -1,29 +1,62 @@
|
|
|
1
|
-
function
|
|
1
|
+
function c() {
|
|
2
2
|
return window.opener && window.opener.location ? window.opener.location.toString() : document.referrer;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
const n =
|
|
4
|
+
function a(e) {
|
|
5
|
+
const n = c().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), t = window.parent || window.opener || !1;
|
|
6
6
|
return t && t.postMessage && n ? (t.postMessage(e, n), !0) : !1;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function w(e) {
|
|
9
|
+
return a({
|
|
10
10
|
metadata: { beat_guid: e },
|
|
11
11
|
mx: !0,
|
|
12
12
|
type: "mx/moneyDashboard/insightOnTransaction"
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function m(e) {
|
|
16
|
+
return a({
|
|
17
17
|
metadata: { template: e },
|
|
18
18
|
mx: !0,
|
|
19
19
|
type: "mx/pulse/client_configured_cta"
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
+
var d = "beat/cta", p = "op_1";
|
|
23
|
+
function f(e, n = p) {
|
|
24
|
+
const t = {
|
|
25
|
+
action: n,
|
|
26
|
+
beat_guid: e.guid,
|
|
27
|
+
beat_template: e.template
|
|
28
|
+
};
|
|
29
|
+
return e?.payload?.action_string && (t.action_string = e.payload.action_string), [d, t];
|
|
30
|
+
}
|
|
31
|
+
function l(e, n, t = "mx/pulse") {
|
|
32
|
+
return window.self === window.top ? !1 : a({
|
|
33
|
+
metadata: n,
|
|
34
|
+
mx: !0,
|
|
35
|
+
type: `${t}/${e}`
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function g(e, n, t = "mx") {
|
|
39
|
+
let o = `${t}://pulse/${e}`;
|
|
40
|
+
n && (o += "?metadata=" + encodeURIComponent(JSON.stringify(n))), window.location.href = o;
|
|
41
|
+
}
|
|
42
|
+
function _(e, { isMobileWebview: n, webviewScheme: t, userGuid: o, op: s } = {}) {
|
|
43
|
+
const [r, u] = f(e, s), i = {
|
|
44
|
+
...u,
|
|
45
|
+
...o ? { user_guid: o } : {}
|
|
46
|
+
};
|
|
47
|
+
n ? g(r, i, t) : l(r, i);
|
|
48
|
+
}
|
|
22
49
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
50
|
+
d as BEAT_CTA_EVENT,
|
|
51
|
+
p as BEAT_OPERATION_1,
|
|
52
|
+
f as getBaseCtaPostMessage,
|
|
53
|
+
c as getReferrer,
|
|
54
|
+
m as postClientConfiguredCta,
|
|
55
|
+
w as postInsightOnTransaction,
|
|
56
|
+
a as postMessageToParent,
|
|
57
|
+
_ as sendBeatCta,
|
|
58
|
+
l as sendBeatPostMessage,
|
|
59
|
+
g as setWebviewURL
|
|
27
60
|
};
|
|
28
61
|
|
|
29
62
|
//# sourceMappingURL=PostMessage.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostMessage.es.js","names":[],"sources":["../../../src/common/utils/PostMessage.ts"],"sourcesContent":["export function getReferrer(): string {\n if (window.opener && window.opener.location) {\n return window.opener.location.toString()\n } else {\n return document.referrer\n }\n}\n\nexport interface PostMessageData {\n metadata?: Record<string, any>\n mx: boolean\n type: string\n [key: string]: any\n}\n\nexport function postMessageToParent(message: PostMessageData): boolean {\n const postUrl = getReferrer().replace(/([^:]+:\\/\\/[^\\/]+).*/, '$1') // eslint-disable-line\n const otherWindow = window.parent || window.opener || false\n\n if (otherWindow && otherWindow.postMessage && postUrl) {\n otherWindow.postMessage(message, postUrl)\n return true\n }\n\n return false\n}\n\nexport function postInsightOnTransaction(beatGuid: string): boolean {\n const message: PostMessageData = {\n metadata: { beat_guid: beatGuid },\n mx: true,\n type: 'mx/moneyDashboard/insightOnTransaction',\n }\n\n return postMessageToParent(message)\n}\n\nexport function postClientConfiguredCta(template: string): boolean {\n const message: PostMessageData = {\n metadata: { template: template },\n mx: true,\n type: 'mx/pulse/client_configured_cta',\n }\n\n return postMessageToParent(message)\n}\n"],"mappings":"AAAA,SAAgB,IAAsB;AACpC,SAAI,OAAO,UAAU,OAAO,OAAO,WAC1B,OAAO,OAAO,SAAS,SAAS,IAEhC,SAAS;AAEpB;AASA,SAAgB,EAAoB,GAAmC;AACrE,QAAM,IAAU,EAAY,EAAE,QAAQ,wBAAwB,IAAI,GAC5D,IAAc,OAAO,UAAU,OAAO,UAAU;AAEtD,SAAI,KAAe,EAAY,eAAe,KAC5C,EAAY,YAAY,GAAS,CAAO,GACjC,MAGF;AACT;AAEA,SAAgB,EAAyB,GAA2B;AAOlE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAE,WAAW,EAAS;AAAA,IAChC,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC;AAEA,SAAgB,EAAwB,GAA2B;AAOjE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAY,UAAA,EAAS;AAAA,IAC/B,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC"}
|
|
1
|
+
{"version":3,"file":"PostMessage.es.js","names":[],"sources":["../../../src/common/utils/PostMessage.ts"],"sourcesContent":["export function getReferrer(): string {\n if (window.opener && window.opener.location) {\n return window.opener.location.toString()\n } else {\n return document.referrer\n }\n}\n\nexport interface PostMessageData {\n metadata?: Record<string, any>\n mx: boolean\n type: string\n [key: string]: any\n}\n\nexport function postMessageToParent(message: PostMessageData): boolean {\n const postUrl = getReferrer().replace(/([^:]+:\\/\\/[^\\/]+).*/, '$1') // eslint-disable-line\n const otherWindow = window.parent || window.opener || false\n\n if (otherWindow && otherWindow.postMessage && postUrl) {\n otherWindow.postMessage(message, postUrl)\n return true\n }\n\n return false\n}\n\nexport function postInsightOnTransaction(beatGuid: string): boolean {\n const message: PostMessageData = {\n metadata: { beat_guid: beatGuid },\n mx: true,\n type: 'mx/moneyDashboard/insightOnTransaction',\n }\n\n return postMessageToParent(message)\n}\n\nexport function postClientConfiguredCta(template: string): boolean {\n const message: PostMessageData = {\n metadata: { template: template },\n mx: true,\n type: 'mx/pulse/client_configured_cta',\n }\n\n return postMessageToParent(message)\n}\n\n// ============================================================================\n// Beat CTA post messages (ported from Pulse: src/utils/PostMessage.js +\n// src/constants/PostMessage.js + src/epics/PostMessage.js).\n//\n// Scope: currently only the Save an extra $100 beat uses this. When a beat CTA\n// has no drilldown drawer, clicking it notifies the host app via a beat/cta\n// post message instead of opening a drawer. Native (mobile webview) hosts can't\n// receive post messages, so we navigate the webview to a custom-scheme URL.\n// ============================================================================\n\nexport const BEAT_CTA_EVENT = 'beat/cta'\nexport const BEAT_OPERATION_1 = 'op_1'\nexport const BEAT_OPERATION_2 = 'op_2'\nexport const BEAT_OPERATION_3 = 'op_3'\n\n/** Minimal beat shape needed to build a CTA post message. */\nexport interface BeatCtaSource {\n guid: string\n template: string\n payload?: { action_string?: string } | null\n}\n\nexport interface BeatCtaPayload {\n action: string\n beat_guid: string\n beat_template: string\n action_string?: string\n [key: string]: unknown\n}\n\n/**\n * Build the `[event, payload]` tuple for a beat CTA post message.\n * Mirrors Pulse's `getBaseCtaPostMessage`.\n */\nexport function getBaseCtaPostMessage(\n beat: BeatCtaSource,\n op: string = BEAT_OPERATION_1,\n): [string, BeatCtaPayload] {\n const payload: BeatCtaPayload = {\n action: op,\n beat_guid: beat.guid,\n beat_template: beat.template,\n }\n\n if (beat?.payload?.action_string) {\n payload.action_string = beat.payload.action_string\n }\n\n return [BEAT_CTA_EVENT, payload]\n}\n\n/**\n * Send a beat post message to the parent window. Only posts when embedded in an\n * iframe (`window.self !== window.top`), mirroring Pulse's `sendPostMessage`\n * (default scheme `mx/pulse`). Returns false when not embedded or no target.\n */\nexport function sendBeatPostMessage(\n event: string,\n data: Record<string, unknown>,\n scheme = 'mx/pulse',\n): boolean {\n if (window.self === window.top) {\n return false\n }\n\n const message: PostMessageData = {\n metadata: data,\n mx: true,\n type: `${scheme}/${event}`,\n }\n\n return postMessageToParent(message)\n}\n\n/**\n * Navigate a mobile webview to a custom-scheme URL instead of posting a message.\n * Mirrors Pulse's `setWebviewURL` (default scheme `mx`).\n */\nexport function setWebviewURL(event: string, data?: Record<string, unknown>, scheme = 'mx'): void {\n let webviewUrl = `${scheme}://pulse/${event}`\n\n if (data) {\n webviewUrl += '?metadata=' + encodeURIComponent(JSON.stringify(data))\n }\n\n window.location.href = webviewUrl\n}\n\nexport interface SendBeatCtaOptions {\n /** True when running inside a native mobile webview. */\n isMobileWebview?: boolean\n /** Custom URL scheme for webview navigation (from client config). */\n webviewScheme?: string\n /** Current user guid, added to the metadata like the Pulse epic does. */\n userGuid?: string\n /** Operation string sent with the CTA (defaults to op_1). */\n op?: string\n}\n\n/**\n * Send a beat CTA to the host: builds the payload, adds `user_guid`, then either\n * posts a message to the host or navigates the webview. Mirrors the behaviour of\n * Pulse's `postMessages` epic (minus the RxJS buffering).\n */\nexport function sendBeatCta(\n beat: BeatCtaSource,\n { isMobileWebview, webviewScheme, userGuid, op }: SendBeatCtaOptions = {},\n): void {\n const [event, basePayload] = getBaseCtaPostMessage(beat, op)\n const metadata: BeatCtaPayload = {\n ...basePayload,\n ...(userGuid ? { user_guid: userGuid } : {}),\n }\n\n if (isMobileWebview) {\n setWebviewURL(event, metadata, webviewScheme)\n } else {\n sendBeatPostMessage(event, metadata)\n }\n}\n"],"mappings":"AAAA,SAAgB,IAAsB;AACpC,SAAI,OAAO,UAAU,OAAO,OAAO,WAC1B,OAAO,OAAO,SAAS,SAAS,IAEhC,SAAS;AAEpB;AASA,SAAgB,EAAoB,GAAmC;AACrE,QAAM,IAAU,EAAY,EAAE,QAAQ,wBAAwB,IAAI,GAC5D,IAAc,OAAO,UAAU,OAAO,UAAU;AAEtD,SAAI,KAAe,EAAY,eAAe,KAC5C,EAAY,YAAY,GAAS,CAAO,GACjC,MAGF;AACT;AAEA,SAAgB,EAAyB,GAA2B;AAOlE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAE,WAAW,EAAS;AAAA,IAChC,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC;AAEA,SAAgB,EAAwB,GAA2B;AAOjE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAY,UAAA,EAAS;AAAA,IAC/B,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC;AAYA,IAAa,IAAiB,YACjB,IAAmB;AAuBhC,SAAgB,EACd,GACA,IAAa,GACa;AAC1B,QAAM,IAA0B;AAAA,IAC9B,QAAQ;AAAA,IACR,WAAW,EAAK;AAAA,IAChB,eAAe,EAAK;AAAA,EACtB;AAEA,SAAI,GAAM,SAAS,kBACjB,EAAQ,gBAAgB,EAAK,QAAQ,gBAGhC,CAAC,GAAgB,CAAO;AACjC;AAOA,SAAgB,EACd,GACA,GACA,IAAS,YACA;AACT,SAAI,OAAO,SAAS,OAAO,MAClB,KASF,EAAoB;AAAA,IALzB,UAAU;AAAA,IACV,IAAI;AAAA,IACJ,MAAM,GAAG,CAAA,IAAU,CAAA;AAAA,EAGM,CAAO;AACpC;AAMA,SAAgB,EAAc,GAAe,GAAgC,IAAS,MAAY;AAChG,MAAI,IAAa,GAAG,CAAA,YAAkB,CAAA;AAEtC,EAAI,MACF,KAAc,eAAe,mBAAmB,KAAK,UAAU,CAAI,CAAC,IAGtE,OAAO,SAAS,OAAO;AACzB;AAkBA,SAAgB,EACd,GACA,EAAE,iBAAA,GAAiB,eAAA,GAAe,UAAA,GAAU,IAAA,EAAA,IAA2B,CAAC,GAClE;AACN,QAAM,CAAC,GAAO,CAAA,IAAe,EAAsB,GAAM,CAAE,GACrD,IAA2B;AAAA,IAC/B,GAAG;AAAA,IACH,GAAI,IAAW,EAAE,WAAW,EAAS,IAAI,CAAC;AAAA,EAC5C;AAEA,EAAI,IACF,EAAc,GAAO,GAAU,CAAa,IAE5C,EAAoB,GAAO,CAAQ;AAEvC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection';
|
|
2
3
|
import { Transaction } from '../../../core';
|
|
3
4
|
interface TabItem {
|
|
4
5
|
label: string;
|
|
@@ -12,12 +13,13 @@ interface TransactionDrillDownProps {
|
|
|
12
13
|
tabs?: TabItem[];
|
|
13
14
|
selectedIndex: number;
|
|
14
15
|
top: React.ReactNode;
|
|
16
|
+
tipSection?: TipSectionProps | false;
|
|
15
17
|
onSelectionChange?: (selectedIndex: number) => void;
|
|
16
18
|
onEachRowClick?: (guid: string) => void;
|
|
17
19
|
transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean;
|
|
18
20
|
baseTransactions?: Transaction[];
|
|
19
21
|
}
|
|
20
|
-
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, onEachRowClick, baseTransactions, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
22
|
+
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
21
23
|
displayName: string;
|
|
22
24
|
};
|
|
23
25
|
export default TransactionDrillDown;
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { exportTransactionsToCSV as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { useGlobalCopyStore as $, useGlobalUiStore as j, useTransactionStore as G } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { exportTransactionsToCSV as P } from "../../../core/utils/TransactionUtils.es.js";
|
|
3
|
+
import A from "../../../common/components/Loader.es.js";
|
|
4
|
+
import E from "../../../transactions/components/shared/TransactionList.es.js";
|
|
5
|
+
import { TipSection as N } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import { observer as
|
|
7
|
+
import { observer as R } from "mobx-react-lite";
|
|
7
8
|
import c from "@mui/material/Stack";
|
|
8
|
-
import { H3 as
|
|
9
|
-
import
|
|
10
|
-
import { Icon as
|
|
9
|
+
import { H3 as U, Text as m } from "@mxenabled/mxui";
|
|
10
|
+
import V from "@mui/material/Button";
|
|
11
|
+
import { Icon as q } from "@mxenabled/mx-icons";
|
|
11
12
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
12
13
|
import p from "@mui/material/Box";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
var
|
|
16
|
-
const { transactions: l } =
|
|
17
|
-
if (!
|
|
18
|
-
const s = !!b?.length,
|
|
19
|
-
|
|
20
|
-
},
|
|
14
|
+
import z from "@mui/material/Tab";
|
|
15
|
+
import J from "@mui/material/Tabs";
|
|
16
|
+
var v = "transaction-drill-down-panel", T = (d) => `transaction-details-tab-${d}`, lo = R(function({ ariaLabel: y, heading: i, subHeadingText: n, icon: C, tabs: b, selectedIndex: e, top: g, onSelectionChange: _, transactionFilter: f, tipSection: h, onEachRowClick: w, baseTransactions: D }) {
|
|
17
|
+
const { transactions: l } = $(), { isCopyLoaded: S } = j(), { sortedTransactionsWithSplits: L, tags: B, detailedTransactions: I } = G();
|
|
18
|
+
if (!S) return /* @__PURE__ */ o(A, {});
|
|
19
|
+
const s = !!b?.length, k = y ?? l.transactions_title, W = (t, a) => {
|
|
20
|
+
_?.(a);
|
|
21
|
+
}, x = f ? (D ?? I).filter(f(e)) : void 0, u = x ?? L;
|
|
21
22
|
return /* @__PURE__ */ r(p, {
|
|
22
23
|
sx: {
|
|
23
24
|
bgcolor: "background.paper",
|
|
24
25
|
width: "100%"
|
|
25
26
|
},
|
|
26
|
-
children: [s && /* @__PURE__ */ o(
|
|
27
|
-
"aria-label":
|
|
28
|
-
onChange:
|
|
27
|
+
children: [s && /* @__PURE__ */ o(J, {
|
|
28
|
+
"aria-label": k,
|
|
29
|
+
onChange: W,
|
|
29
30
|
value: e,
|
|
30
31
|
variant: "fullWidth",
|
|
31
|
-
children: b.map((t, a) => /* @__PURE__ */ o(
|
|
32
|
-
"aria-controls":
|
|
32
|
+
children: b.map((t, a) => /* @__PURE__ */ o(z, {
|
|
33
|
+
"aria-controls": v,
|
|
33
34
|
"aria-label": t.ariaLabel,
|
|
34
|
-
id:
|
|
35
|
+
id: T(a),
|
|
35
36
|
label: t.label,
|
|
36
37
|
sx: {
|
|
37
38
|
minWidth: "auto",
|
|
@@ -39,8 +40,8 @@ var u = "transaction-drill-down-panel", v = (m) => `transaction-details-tab-${m}
|
|
|
39
40
|
}
|
|
40
41
|
}, `${t.label}-${a}`))
|
|
41
42
|
}), /* @__PURE__ */ r(p, {
|
|
42
|
-
"aria-labelledby": s ?
|
|
43
|
-
id:
|
|
43
|
+
"aria-labelledby": s ? T(e) : void 0,
|
|
44
|
+
id: v,
|
|
44
45
|
role: s ? "tabpanel" : void 0,
|
|
45
46
|
children: [
|
|
46
47
|
(i || n) && /* @__PURE__ */ r(c, {
|
|
@@ -49,13 +50,13 @@ var u = "transaction-drill-down-panel", v = (m) => `transaction-details-tab-${m}
|
|
|
49
50
|
pt: 16,
|
|
50
51
|
px: 24
|
|
51
52
|
},
|
|
52
|
-
children: [i && /* @__PURE__ */ o(
|
|
53
|
+
children: [i && /* @__PURE__ */ o(U, { children: i }), n && /* @__PURE__ */ r(c, {
|
|
53
54
|
sx: {
|
|
54
55
|
alignItems: "center",
|
|
55
56
|
flexDirection: "row",
|
|
56
57
|
gap: 8
|
|
57
58
|
},
|
|
58
|
-
children: [
|
|
59
|
+
children: [C, /* @__PURE__ */ o(m, {
|
|
59
60
|
textTransform: "uppercase",
|
|
60
61
|
variant: "body2",
|
|
61
62
|
children: n
|
|
@@ -64,8 +65,9 @@ var u = "transaction-drill-down-panel", v = (m) => `transaction-details-tab-${m}
|
|
|
64
65
|
}),
|
|
65
66
|
/* @__PURE__ */ o(p, {
|
|
66
67
|
sx: { pt: 16 },
|
|
67
|
-
children:
|
|
68
|
+
children: g
|
|
68
69
|
}),
|
|
70
|
+
h && /* @__PURE__ */ o(N, { ...h }),
|
|
69
71
|
/* @__PURE__ */ r(c, {
|
|
70
72
|
sx: {
|
|
71
73
|
alignItems: "center",
|
|
@@ -78,34 +80,34 @@ var u = "transaction-drill-down-panel", v = (m) => `transaction-details-tab-${m}
|
|
|
78
80
|
pt: 16,
|
|
79
81
|
px: 24
|
|
80
82
|
},
|
|
81
|
-
children: [/* @__PURE__ */ o(
|
|
83
|
+
children: [/* @__PURE__ */ o(m, {
|
|
82
84
|
bold: !0,
|
|
83
85
|
variant: "body1",
|
|
84
86
|
children: l.transactions_title
|
|
85
|
-
}),
|
|
87
|
+
}), u.length > 0 && /* @__PURE__ */ o(V, {
|
|
86
88
|
onClick: () => {
|
|
87
|
-
|
|
89
|
+
P(u, B);
|
|
88
90
|
},
|
|
89
|
-
startIcon: /* @__PURE__ */ o(
|
|
91
|
+
startIcon: /* @__PURE__ */ o(q, { name: "ios_share" }),
|
|
90
92
|
sx: { height: 28 },
|
|
91
|
-
children: /* @__PURE__ */ o(
|
|
93
|
+
children: /* @__PURE__ */ o(m, {
|
|
92
94
|
bold: !0,
|
|
93
95
|
variant: "body2",
|
|
94
96
|
children: l.export_csv_btn
|
|
95
97
|
})
|
|
96
98
|
})]
|
|
97
99
|
}),
|
|
98
|
-
/* @__PURE__ */ o(
|
|
99
|
-
transaction:
|
|
100
|
-
onClick:
|
|
100
|
+
/* @__PURE__ */ o(E, {
|
|
101
|
+
transaction: x,
|
|
102
|
+
onClick: w
|
|
101
103
|
})
|
|
102
104
|
]
|
|
103
105
|
})]
|
|
104
106
|
});
|
|
105
107
|
});
|
|
106
108
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
lo as TransactionDrillDown,
|
|
110
|
+
lo as default
|
|
109
111
|
};
|
|
110
112
|
|
|
111
113
|
//# 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 { 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 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 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 <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 )\n})\n\nexport default TransactionDrillDown\n"],"mappings":"
|
|
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 {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 )\n})\n\nexport default TransactionDrillDown\n"],"mappings":"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"}
|
|
@@ -1,105 +1,114 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import
|
|
5
|
-
import { BarChartV2 as
|
|
6
|
-
import { EmptyBarChart as
|
|
7
|
-
import { TransactionDrillDown as
|
|
8
|
-
import { useTransactionHistory as
|
|
9
|
-
import { getDefaultSelection as
|
|
10
|
-
import { TransactionDetailsBlock as
|
|
11
|
-
import { useLayoutEffect as
|
|
12
|
-
import { observer as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { useTheme as
|
|
15
|
-
var
|
|
16
|
-
const
|
|
1
|
+
import { useGlobalCopyStore as Q, useGlobalUiStore as W, useInsightsV2Store as X } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import Y from "../../../common/components/drawer/Drawer.es.js";
|
|
3
|
+
import { formatCurrency as Z } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import tt from "../../../common/components/Loader.es.js";
|
|
5
|
+
import { BarChartV2 as et } from "../../components/chartblocks/BarchartV2.es.js";
|
|
6
|
+
import { EmptyBarChart as at } from "../../components/chartblocks/EmptyBarChart.es.js";
|
|
7
|
+
import { TransactionDrillDown as ot } from "./TransactionDrillDown.es.js";
|
|
8
|
+
import { useTransactionHistory as nt } from "./useTransactionHistory.es.js";
|
|
9
|
+
import { getDefaultSelection as rt, getDrillDownConfig as it, getFlattenedDataSeries as st, toStoreFilter as lt } from "./utils.es.js";
|
|
10
|
+
import { TransactionDetailsBlock as ct } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
11
|
+
import { useLayoutEffect as dt, useState as u } from "react";
|
|
12
|
+
import { observer as mt } from "mobx-react-lite";
|
|
13
|
+
import { Fragment as gt, jsx as o, jsxs as pt } from "react/jsx-runtime";
|
|
14
|
+
import { useTheme as ut } from "@mui/material/styles";
|
|
15
|
+
var It = mt(({ beat: a }) => {
|
|
16
|
+
const b = ut(), { instanceSlotData: e, beatTransactions: s, spendCategoryGuids: h, allAccountGuids: f, categoryName: v, displayedDateRange: m, transactionStore: x } = nt(a), { actionDrawer: y, setActionContext: C } = X(), { common: B, insights_feed: l } = Q(), { isCopyLoaded: F } = W(), [I, T] = u(!1), [G, A] = u(!1), { insights_payload: n } = a, j = y.trigger === "secondaryCta" ? n?.secondary_cta?.variant : n?.primary_cta?.variant, { top: g, filterMode: c, header: k, colors: w, filterStrategy: H, tipSection: S } = it(j ?? ""), { dataSeries: d, chartData: r, comparisonBars: E } = st({
|
|
17
17
|
data: e?.data_series,
|
|
18
18
|
ariaLabel: e?.ariaLabel ?? "",
|
|
19
|
-
top:
|
|
20
|
-
beatTransactions:
|
|
19
|
+
top: g,
|
|
20
|
+
beatTransactions: s,
|
|
21
21
|
payload: e
|
|
22
|
-
}), { chartBarIndex:
|
|
22
|
+
}), { chartBarIndex: K, subTabIndex: O } = rt({
|
|
23
23
|
chartTabCount: r.length,
|
|
24
|
-
comparisonTabCount:
|
|
25
|
-
actionDrawer:
|
|
24
|
+
comparisonTabCount: E.length,
|
|
25
|
+
actionDrawer: y,
|
|
26
26
|
beatGuid: a.guid
|
|
27
|
-
}), [
|
|
27
|
+
}), [i, _] = u(K), D = (t) => H({
|
|
28
28
|
beat: a,
|
|
29
|
-
beatTransactions:
|
|
30
|
-
dataSeries:
|
|
29
|
+
beatTransactions: s,
|
|
30
|
+
dataSeries: d,
|
|
31
31
|
selectedIndex: t,
|
|
32
|
-
subIndex:
|
|
33
|
-
isLastTab: t ===
|
|
32
|
+
subIndex: O,
|
|
33
|
+
isLastTab: t === d.length - 1,
|
|
34
34
|
instanceSlotData: e,
|
|
35
|
-
spendCategoryGuids:
|
|
36
|
-
displayedDateRange:
|
|
37
|
-
}),
|
|
38
|
-
|
|
39
|
-
allAccountGuids:
|
|
40
|
-
displayedDateRange:
|
|
35
|
+
spendCategoryGuids: h,
|
|
36
|
+
displayedDateRange: m
|
|
37
|
+
}), V = s.map((t) => t.guid).join(","), R = h.join(","), M = f.join(","), L = () => {
|
|
38
|
+
c !== "store" || !d.length || x.setFilter(lt(D(i), {
|
|
39
|
+
allAccountGuids: f,
|
|
40
|
+
displayedDateRange: m
|
|
41
41
|
}));
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
dt(() => {
|
|
44
|
+
L();
|
|
45
45
|
}, [
|
|
46
46
|
a.guid,
|
|
47
|
-
|
|
48
|
-
s,
|
|
49
|
-
l.length,
|
|
50
|
-
e,
|
|
47
|
+
i,
|
|
51
48
|
c,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
d.length,
|
|
50
|
+
e,
|
|
51
|
+
m,
|
|
52
|
+
R,
|
|
53
|
+
M,
|
|
54
|
+
V
|
|
55
55
|
]);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const p = k?.({
|
|
57
|
+
title: n?.title,
|
|
58
|
+
subHeader: n?.sub_title,
|
|
59
59
|
categoryName: v,
|
|
60
|
-
selectedDate: r[
|
|
61
|
-
}),
|
|
60
|
+
selectedDate: r[i]?.date ?? void 0
|
|
61
|
+
}), N = w(b, e?.category_guid);
|
|
62
|
+
if (!F) return /* @__PURE__ */ o(tt, {});
|
|
63
|
+
const P = [l.general.monthly_amount, l.general.trend], [U, $] = e?.legends?.length ? e.legends.map((t) => t.label) : P, q = c === "local" ? (t) => D(t).custom ?? (() => !0) : void 0, z = c === "local" ? s : void 0, J = g === "singleBar" || g === "upcomingBill" ? r.length ? /* @__PURE__ */ o(et, {
|
|
62
64
|
amounts: {
|
|
63
65
|
average: e?.average_amount,
|
|
64
|
-
formattedAverage:
|
|
66
|
+
formattedAverage: Z(e?.average_amount ?? 0, "0,0.00")
|
|
65
67
|
},
|
|
66
|
-
color:
|
|
68
|
+
color: N[0] ?? b.palette.primary.main,
|
|
67
69
|
data: r,
|
|
68
70
|
legendPosition: "top",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
margin: {
|
|
72
|
+
bottom: 30,
|
|
73
|
+
top: 20,
|
|
74
|
+
left: 24,
|
|
75
|
+
right: 24
|
|
76
|
+
},
|
|
77
|
+
monthlyAmountLabel: U,
|
|
78
|
+
onBarClick: _,
|
|
79
|
+
selectedTabIndex: i,
|
|
80
|
+
trendAmountLabel: $
|
|
81
|
+
}) : /* @__PURE__ */ o(at, {}) : null;
|
|
82
|
+
return /* @__PURE__ */ pt(gt, { children: [/* @__PURE__ */ o(ot, {
|
|
75
83
|
ariaLabel: e?.ariaLabel,
|
|
76
|
-
baseTransactions:
|
|
77
|
-
heading:
|
|
78
|
-
icon:
|
|
79
|
-
onSelectionChange:
|
|
80
|
-
selectedIndex:
|
|
81
|
-
subHeadingText:
|
|
84
|
+
baseTransactions: z,
|
|
85
|
+
heading: p?.heading,
|
|
86
|
+
icon: p?.icon,
|
|
87
|
+
onSelectionChange: _,
|
|
88
|
+
selectedIndex: i,
|
|
89
|
+
subHeadingText: p?.subHeadingText,
|
|
82
90
|
tabs: r.map((t) => ({
|
|
83
91
|
ariaLabel: t.ariaLabel,
|
|
84
92
|
label: t.label
|
|
85
93
|
})),
|
|
86
|
-
top:
|
|
87
|
-
|
|
94
|
+
top: J,
|
|
95
|
+
...S && { tipSection: !G && S(A, l, n?.sub_title?.text) },
|
|
96
|
+
transactionFilter: q,
|
|
88
97
|
onEachRowClick: (t) => {
|
|
89
|
-
|
|
98
|
+
C({ transaction_guid: t }), T(!0);
|
|
90
99
|
}
|
|
91
|
-
}), /* @__PURE__ */ o(
|
|
92
|
-
ariaLabelClose:
|
|
93
|
-
isOpen:
|
|
100
|
+
}), /* @__PURE__ */ o(Y, {
|
|
101
|
+
ariaLabelClose: B.close_aria,
|
|
102
|
+
isOpen: I,
|
|
94
103
|
onClose: () => {
|
|
95
|
-
|
|
104
|
+
T(!1), C({ transaction_guid: void 0 }), L();
|
|
96
105
|
},
|
|
97
|
-
title:
|
|
98
|
-
children: /* @__PURE__ */ o(
|
|
99
|
-
})] })
|
|
106
|
+
title: l.general.transaction_details_title,
|
|
107
|
+
children: /* @__PURE__ */ o(ct, { beat: a })
|
|
108
|
+
})] });
|
|
100
109
|
});
|
|
101
110
|
export {
|
|
102
|
-
|
|
111
|
+
It as TransactionHistoryBlock
|
|
103
112
|
};
|
|
104
113
|
|
|
105
114
|
//# sourceMappingURL=TransactionHistoryBlock.es.js.map
|