@mx-cartographer/experiences 9.3.4 → 9.3.6
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 +9 -0
- package/dist/core/constants/DateFormats.d.ts +5 -0
- package/dist/core/constants/DateFormats.es.js +7 -2
- package/dist/core/constants/DateFormats.es.js.map +1 -1
- package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2.d.ts +8 -0
- package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2.es.js +50 -0
- package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2.es.js.map +1 -0
- package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2Body.d.ts +8 -0
- package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2Body.es.js +68 -0
- package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2Body.es.js.map +1 -0
- package/dist/insights/components/insights/TransparentOverdraftV2/index.d.ts +1 -0
- package/dist/insights/components/insights/index.d.ts +1 -0
- package/dist/insights/index.es.js +25 -23
- package/dist/transactions/components/shared/TransactionDetails.es.js +109 -108
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/TransactionAmountHeader.es.js +13 -12
- package/dist/transactions/components/shared/transactiondetails/TransactionAmountHeader.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/TransactionDetailsView.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/TransactionDetailsView.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.es.js +8 -8
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [9.3.6] - 08-12-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Creating the new TransparentOverdraftV2 insight
|
|
4
|
+
|
|
5
|
+
## [9.3.5] - 08-12-2026
|
|
6
|
+
|
|
7
|
+
- **FIXED** - Transaction detail view showed transfer/credit amounts (e.g. an account-to-account transfer deposit) as an unsigned, default-colored amount because the header keyed off `isIncome` (true only for the Income category) while the list keyed off `transaction_type`; the detail view now uses `transaction_type === CREDIT` so credits render as `+$Amount` in success green, consistent with the transactions list (MEW-3703)
|
|
8
|
+
- **CHANGED** - Transaction detail view date now renders as `Month DD, YYYY` (e.g. `June 08, 2026`) instead of the numeric `MM/DD/YYYY` format, per design; added a `FULL_MONTH_DAY_YEAR` date format (MEW-3703)
|
|
9
|
+
|
|
1
10
|
## [9.3.4] - 08-12-2026
|
|
2
11
|
|
|
3
12
|
- **FIXED** - Blank rows in "Manage Insights Notifications": 10 members of `InsightNotificationTypes` were rendered by the settings list but had no entry in `getProfileLabel`'s `labelMap`, so they displayed a working, toggleable notification row with an empty title (MEW2-2872)
|
|
@@ -45,11 +45,16 @@ var _ = {
|
|
|
45
45
|
month: "short",
|
|
46
46
|
day: "numeric",
|
|
47
47
|
year: "numeric"
|
|
48
|
+
},
|
|
49
|
+
FULL_MONTH_DAY_YEAR: {
|
|
50
|
+
month: "long",
|
|
51
|
+
day: "2-digit",
|
|
52
|
+
year: "numeric"
|
|
48
53
|
}
|
|
49
|
-
},
|
|
54
|
+
}, i = (n, o) => t(new Date(n), Object.assign(o), { locale: r() });
|
|
50
55
|
export {
|
|
51
56
|
_ as DATE_FORMATS_INTL,
|
|
52
|
-
|
|
57
|
+
i as formatDate
|
|
53
58
|
};
|
|
54
59
|
|
|
55
60
|
//# sourceMappingURL=DateFormats.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFormats.es.js","names":[],"sources":["../../../src/core/constants/DateFormats.ts"],"sourcesContent":["import { intlFormat } from 'date-fns/intlFormat'\nimport { getLocale } from '../utils'\n\nexport const ORDINAL_DATE_FORMAT = 'do'\nexport const ORDINAL_MONTH_DAY_YEAR_FORMAT = 'MMM do, yyyy'\n\n// Documentation on the options for formatting int'l dates\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat\nexport const DATE_FORMATS_INTL = {\n TIME_STAMP_HOUR_MINUTE: {\n hour: 'numeric',\n minute: 'numeric',\n },\n DAY: {\n day: 'numeric',\n },\n DAY_OF_WEEK: {\n weekday: 'long',\n },\n DAY_OF_WEEK_MONTH_DAY: {\n day: 'numeric',\n month: 'long',\n weekday: 'long',\n },\n FULL_MONTH_DAY: {\n day: 'numeric',\n month: 'long',\n },\n MONTH: {\n month: 'short',\n },\n MONTH_DAY: {\n day: 'numeric',\n month: 'short',\n },\n MONTH_LONG: {\n month: 'long',\n },\n MONTH_SHORT: {\n month: 'short',\n },\n MONTH_SHORT_YEAR: {\n month: 'short',\n year: 'numeric',\n },\n MONTH_YEAR: {\n month: 'long',\n year: 'numeric',\n },\n YEAR_MONTH_DAY: {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n },\n MONTH_DAY_YEAR: {\n month: 'short',\n day: '2-digit',\n year: 'numeric',\n },\n MED_MONTH_SHORT_DAY_FULL_YEAR: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n}\n\nexport interface Day {\n day: string\n}\n\nexport interface DayOfWeek {\n weekday: string\n}\n\nexport interface DayOfWeekMonthDay {\n day: string\n month: string\n weekday: string\n}\n\nexport interface MonthDay {\n day: string\n month: string\n}\n\nexport interface MonthLong {\n month: string\n}\n\nexport interface MonthShort {\n month: string\n}\n\nexport interface MonthYear {\n month: string\n year: string\n}\n\nexport interface TimeStamp {\n hour: string\n minute: string\n}\n\nexport interface YearMonthDay {\n day: string\n month: string\n year: string\n}\n\nexport const formatDate = (\n date: string | Date,\n dFormat:\n | Day\n | DayOfWeek\n | DayOfWeekMonthDay\n | MonthDay\n | MonthLong\n | MonthShort\n | MonthYear\n | TimeStamp\n | YearMonthDay,\n) => intlFormat(new Date(date), Object.assign(dFormat), { locale: getLocale() })\n"],"mappings":";;AAQA,IAAa,IAAoB;AAAA,EAC/B,wBAAwB;AAAA,IACtB,MAAM;AAAA,IACN,QAAQ;AAAA,EACV;AAAA,EACA,KAAK,EACH,KAAK,UACP;AAAA,EACA,aAAa,EACX,SAAS,OACX;AAAA,EACA,uBAAuB;AAAA,IACrB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB;AAAA,IACd,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AAAA,EACA,OAAO,EACL,OAAO,QACT;AAAA,EACA,WAAW;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AAAA,EACA,YAAY,EACV,OAAO,OACT;AAAA,EACA,aAAa,EACX,OAAO,QACT;AAAA,EACA,kBAAkB;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,YAAY;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,gBAAgB;AAAA,IACd,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA,+BAA+B;AAAA,IAC7B,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AACF,GA6Ca,IAAA,CACX,GACA,MAUG,EAAW,IAAI,KAAK,CAAI,GAAG,OAAO,OAAO,CAAO,GAAG,EAAE,QAAQ,EAAU,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"DateFormats.es.js","names":[],"sources":["../../../src/core/constants/DateFormats.ts"],"sourcesContent":["import { intlFormat } from 'date-fns/intlFormat'\nimport { getLocale } from '../utils'\n\nexport const ORDINAL_DATE_FORMAT = 'do'\nexport const ORDINAL_MONTH_DAY_YEAR_FORMAT = 'MMM do, yyyy'\n\n// Documentation on the options for formatting int'l dates\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat\nexport const DATE_FORMATS_INTL = {\n TIME_STAMP_HOUR_MINUTE: {\n hour: 'numeric',\n minute: 'numeric',\n },\n DAY: {\n day: 'numeric',\n },\n DAY_OF_WEEK: {\n weekday: 'long',\n },\n DAY_OF_WEEK_MONTH_DAY: {\n day: 'numeric',\n month: 'long',\n weekday: 'long',\n },\n FULL_MONTH_DAY: {\n day: 'numeric',\n month: 'long',\n },\n MONTH: {\n month: 'short',\n },\n MONTH_DAY: {\n day: 'numeric',\n month: 'short',\n },\n MONTH_LONG: {\n month: 'long',\n },\n MONTH_SHORT: {\n month: 'short',\n },\n MONTH_SHORT_YEAR: {\n month: 'short',\n year: 'numeric',\n },\n MONTH_YEAR: {\n month: 'long',\n year: 'numeric',\n },\n YEAR_MONTH_DAY: {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n },\n MONTH_DAY_YEAR: {\n month: 'short',\n day: '2-digit',\n year: 'numeric',\n },\n MED_MONTH_SHORT_DAY_FULL_YEAR: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n FULL_MONTH_DAY_YEAR: {\n month: 'long',\n day: '2-digit',\n year: 'numeric',\n },\n}\n\nexport interface Day {\n day: string\n}\n\nexport interface DayOfWeek {\n weekday: string\n}\n\nexport interface DayOfWeekMonthDay {\n day: string\n month: string\n weekday: string\n}\n\nexport interface MonthDay {\n day: string\n month: string\n}\n\nexport interface MonthLong {\n month: string\n}\n\nexport interface MonthShort {\n month: string\n}\n\nexport interface MonthYear {\n month: string\n year: string\n}\n\nexport interface TimeStamp {\n hour: string\n minute: string\n}\n\nexport interface YearMonthDay {\n day: string\n month: string\n year: string\n}\n\nexport const formatDate = (\n date: string | Date,\n dFormat:\n | Day\n | DayOfWeek\n | DayOfWeekMonthDay\n | MonthDay\n | MonthLong\n | MonthShort\n | MonthYear\n | TimeStamp\n | YearMonthDay,\n) => intlFormat(new Date(date), Object.assign(dFormat), { locale: getLocale() })\n"],"mappings":";;AAQA,IAAa,IAAoB;AAAA,EAC/B,wBAAwB;AAAA,IACtB,MAAM;AAAA,IACN,QAAQ;AAAA,EACV;AAAA,EACA,KAAK,EACH,KAAK,UACP;AAAA,EACA,aAAa,EACX,SAAS,OACX;AAAA,EACA,uBAAuB;AAAA,IACrB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB;AAAA,IACd,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AAAA,EACA,OAAO,EACL,OAAO,QACT;AAAA,EACA,WAAW;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AAAA,EACA,YAAY,EACV,OAAO,OACT;AAAA,EACA,aAAa,EACX,OAAO,QACT;AAAA,EACA,kBAAkB;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,YAAY;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,gBAAgB;AAAA,IACd,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA,+BAA+B;AAAA,IAC7B,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA,qBAAqB;AAAA,IACnB,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AACF,GA6Ca,IAAA,CACX,GACA,MAUG,EAAW,IAAI,KAAK,CAAI,GAAG,OAAO,OAAO,CAAO,GAAG,EAAE,QAAQ,EAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CommonBeatProps } from '../../../types/CommonBeat';
|
|
3
|
+
export interface TransparentOverdraftV2Props extends CommonBeatProps {
|
|
4
|
+
accountName: string;
|
|
5
|
+
formattedProjectedBalance: string;
|
|
6
|
+
projectedBalanceLabel: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TransparentOverdraftV2: React.FC<TransparentOverdraftV2Props>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { InsightButton as i } from "../../shared/InsightsCard/InsightButton.es.js";
|
|
2
|
+
import { BeatCardMUI as s } from "../../shared/InsightsCard/BeatCardMUI.es.js";
|
|
3
|
+
import { TransparentOverdraftV2Body as c } from "./TransparentOverdraftV2Body.es.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import n from "@mui/material/Stack";
|
|
6
|
+
import { Text as f } from "@mxenabled/mxui";
|
|
7
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
8
|
+
var T = ({ accountName: m, beat: t, buttonProps: e, formattedProjectedBalance: d, isMini: o, projectedBalanceLabel: p, ...a }) => /* @__PURE__ */ r(s, {
|
|
9
|
+
...a,
|
|
10
|
+
beat: t,
|
|
11
|
+
button: /* @__PURE__ */ h(n, {
|
|
12
|
+
sx: { gap: 8 },
|
|
13
|
+
children: [/* @__PURE__ */ r(i, {
|
|
14
|
+
...e,
|
|
15
|
+
beat: t
|
|
16
|
+
}), /* @__PURE__ */ r(i, {
|
|
17
|
+
...e,
|
|
18
|
+
beat: t,
|
|
19
|
+
hide: !t.supporting_action,
|
|
20
|
+
primary: !1
|
|
21
|
+
})]
|
|
22
|
+
}),
|
|
23
|
+
header: {
|
|
24
|
+
...a.header,
|
|
25
|
+
subHeader: /* @__PURE__ */ r(n, {
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
direction: "row",
|
|
28
|
+
sx: {
|
|
29
|
+
gap: 4,
|
|
30
|
+
mt: 4
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ r(f, {
|
|
33
|
+
sx: { color: "text.secondary" },
|
|
34
|
+
variant: "body2",
|
|
35
|
+
children: m
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
isMini: o,
|
|
40
|
+
children: /* @__PURE__ */ r(c, {
|
|
41
|
+
formattedProjectedBalance: d,
|
|
42
|
+
isMini: o ?? !1,
|
|
43
|
+
projectedBalanceLabel: p
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
T as TransparentOverdraftV2
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=TransparentOverdraftV2.es.js.map
|
package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2.es.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentOverdraftV2.es.js","names":[],"sources":["../../../../../src/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport Stack from '@mui/material/Stack'\n\nimport { CommonBeatProps } from '../../../types/CommonBeat'\nimport { BeatCardMUI } from '../../shared/InsightsCard/BeatCardMUI'\nimport { InsightButton } from '../../shared/InsightsCard/InsightButton'\n\nimport { TransparentOverdraftV2Body } from './TransparentOverdraftV2Body'\n\nexport interface TransparentOverdraftV2Props extends CommonBeatProps {\n accountName: string\n formattedProjectedBalance: string\n projectedBalanceLabel: string\n}\n\nexport const TransparentOverdraftV2: React.FC<TransparentOverdraftV2Props> = ({\n accountName,\n beat,\n buttonProps,\n formattedProjectedBalance,\n isMini,\n projectedBalanceLabel,\n ...restProps\n}) => {\n return (\n <BeatCardMUI\n {...restProps}\n beat={beat}\n button={\n <Stack sx={{ gap: 8 }}>\n <InsightButton {...buttonProps} beat={beat} />\n <InsightButton\n {...buttonProps}\n beat={beat}\n hide={!beat.supporting_action}\n primary={false}\n />\n </Stack>\n }\n header={{\n ...restProps.header,\n subHeader: (\n <Stack alignItems=\"center\" direction=\"row\" sx={{ gap: 4, mt: 4 }}>\n {/* Remove InstitutionLogo until the V2 payload carries institution_guid */}\n <Text sx={{ color: 'text.secondary' }} variant=\"body2\">\n {accountName}\n </Text>\n </Stack>\n ),\n }}\n isMini={isMini}\n >\n <TransparentOverdraftV2Body\n formattedProjectedBalance={formattedProjectedBalance}\n isMini={isMini ?? false}\n projectedBalanceLabel={projectedBalanceLabel}\n />\n </BeatCardMUI>\n )\n}\n"],"mappings":";;;;;;;AAkBA,IAAa,IAAA,CAAiE,EAC5E,aAAA,GACA,MAAA,GACA,aAAA,GACA,2BAAA,GACA,QAAA,GACA,uBAAA,GACA,GAAG,EAAA,MAGD,gBAAA,EAAC,GAAD;AAAA,EACE,GAAI;AAAA,EACE,MAAA;AAAA,EACN,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,KAAK,EAAE;AAAA,IAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAe,GAAI;AAAA,MAAmB,MAAA;AAAA,IAAO,CAAA,GAC7C,gBAAA,EAAC,GAAD;AAAA,MACE,GAAI;AAAA,MACE,MAAA;AAAA,MACN,MAAM,CAAC,EAAK;AAAA,MACZ,SAAS;AAAA,IACV,CAAA,CACI;AAAA;EAET,QAAQ;AAAA,IACN,GAAG,EAAU;AAAA,IACb,WACE,gBAAA,EAAC,GAAD;AAAA,MAAO,YAAW;AAAA,MAAS,WAAU;AAAA,MAAM,IAAI;AAAA,QAAE,KAAK;AAAA,QAAG,IAAI;AAAA,MAAE;AAAA,MAE7D,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA;AAAA,MACG,CAAA;AAAA,IACD,CAAA;AAAA,EAEX;AAAA,EACQ,QAAA;AAAA,EAER,UAAA,gBAAA,EAAC,GAAD;AAAA,IAC6B,2BAAA;AAAA,IAC3B,QAAQ,KAAU;AAAA,IACK,uBAAA;AAAA,EACxB,CAAA;AACU,CAAA"}
|
package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2Body.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface TransparentOverdraftV2BodyProps {
|
|
3
|
+
formattedProjectedBalance: string;
|
|
4
|
+
isMini: boolean;
|
|
5
|
+
projectedBalanceLabel: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const TransparentOverdraftV2Body: React.FC<TransparentOverdraftV2BodyProps>;
|
|
8
|
+
export {};
|
package/dist/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2Body.es.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "@mui/material/Stack";
|
|
3
|
+
import { P as c, Text as m } from "@mxenabled/mxui";
|
|
4
|
+
import { Icon as s } from "@mxenabled/mx-icons";
|
|
5
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
6
|
+
import d from "@mui/material/Card";
|
|
7
|
+
var y = ({ formattedProjectedBalance: i, isMini: o = !1, projectedBalanceLabel: a }) => {
|
|
8
|
+
const t = {
|
|
9
|
+
boxContainer: {
|
|
10
|
+
bgcolor: "warning.light",
|
|
11
|
+
marginBottom: o ? 0 : 24,
|
|
12
|
+
py: 16,
|
|
13
|
+
px: 24,
|
|
14
|
+
width: "100%"
|
|
15
|
+
},
|
|
16
|
+
card: {
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
borderRadius: 2,
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
p: 16,
|
|
23
|
+
width: "100%"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ r(e, {
|
|
27
|
+
sx: t.boxContainer,
|
|
28
|
+
children: /* @__PURE__ */ n(d, {
|
|
29
|
+
sx: {
|
|
30
|
+
...t.card,
|
|
31
|
+
bgcolor: "background.paper"
|
|
32
|
+
},
|
|
33
|
+
children: [/* @__PURE__ */ r(m, {
|
|
34
|
+
component: "span",
|
|
35
|
+
sx: {
|
|
36
|
+
color: "text.primary",
|
|
37
|
+
fontWeight: 700,
|
|
38
|
+
mb: 4
|
|
39
|
+
},
|
|
40
|
+
variant: o ? "h2" : "h1",
|
|
41
|
+
children: i
|
|
42
|
+
}), /* @__PURE__ */ n(e, {
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
direction: "row",
|
|
45
|
+
sx: { gap: 4 },
|
|
46
|
+
children: [/* @__PURE__ */ r(s, {
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
fill: !0,
|
|
49
|
+
name: "error",
|
|
50
|
+
size: 16,
|
|
51
|
+
sx: { color: "warning.main" }
|
|
52
|
+
}), /* @__PURE__ */ r(c, {
|
|
53
|
+
sx: {
|
|
54
|
+
color: "text.secondary",
|
|
55
|
+
fontWeight: 400
|
|
56
|
+
},
|
|
57
|
+
variant: "body2",
|
|
58
|
+
children: a
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
y as TransparentOverdraftV2Body
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=TransparentOverdraftV2Body.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentOverdraftV2Body.es.js","names":[],"sources":["../../../../../src/insights/components/insights/TransparentOverdraftV2/TransparentOverdraftV2Body.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { P, Text } from '@mxenabled/mxui'\n\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\ninterface TransparentOverdraftV2BodyProps {\n formattedProjectedBalance: string\n isMini: boolean\n projectedBalanceLabel: string\n}\n\nexport const TransparentOverdraftV2Body: React.FC<TransparentOverdraftV2BodyProps> = ({\n formattedProjectedBalance,\n isMini = false,\n projectedBalanceLabel,\n}) => {\n const styles = {\n boxContainer: {\n bgcolor: 'warning.light',\n marginBottom: isMini ? 0 : 24,\n py: 16,\n px: 24,\n width: '100%',\n },\n card: {\n alignItems: 'center',\n borderRadius: 2,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n p: 16,\n width: '100%',\n },\n }\n\n return (\n <Stack sx={styles.boxContainer}>\n <Card\n sx={{\n ...styles.card,\n bgcolor: 'background.paper',\n }}\n >\n <Text\n component=\"span\"\n sx={{ color: 'text.primary', fontWeight: 700, mb: 4 }}\n variant={isMini ? 'h2' : 'h1'}\n >\n {formattedProjectedBalance}\n </Text>\n\n <Stack alignItems=\"center\" direction=\"row\" sx={{ gap: 4 }}>\n <Icon\n aria-hidden=\"true\"\n fill={true}\n name=\"error\"\n size={16}\n sx={{ color: 'warning.main' }}\n />\n <P sx={{ color: 'text.secondary', fontWeight: 400 }} variant=\"body2\">\n {projectedBalanceLabel}\n </P>\n </Stack>\n </Card>\n </Stack>\n )\n}\n"],"mappings":";;;;;;AAcA,IAAa,IAAA,CAAyE,EACpF,2BAAA,GACA,QAAA,IAAS,IACT,uBAAA,EAAA,MACI;AACJ,QAAM,IAAS;AAAA,IACb,cAAc;AAAA,MACZ,SAAS;AAAA,MACT,cAAc,IAAS,IAAI;AAAA,MAC3B,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IACA,MAAM;AAAA,MACJ,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,SAAS;AAAA,MACT,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,GAAG;AAAA,MACH,OAAO;AAAA,IACT;AAAA,EACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAO;AAAA,IAChB,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,GAAG,EAAO;AAAA,QACV,SAAS;AAAA,MACX;AAAA,MAJF,UAAA,CAME,gBAAA,EAAC,GAAD;AAAA,QACE,WAAU;AAAA,QACV,IAAI;AAAA,UAAE,OAAO;AAAA,UAAgB,YAAY;AAAA,UAAK,IAAI;AAAA,QAAE;AAAA,QACpD,SAAS,IAAS,OAAO;AAAA,QAExB,UAAA;AAAA,MACG,CAAA,GAEN,gBAAA,EAAC,GAAD;AAAA,QAAO,YAAW;AAAA,QAAS,WAAU;AAAA,QAAM,IAAI,EAAE,KAAK,EAAE;AAAA,QAAxD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UACE,eAAY;AAAA,UACZ,MAAM;AAAA,UACN,MAAK;AAAA,UACL,MAAM;AAAA,UACN,IAAI,EAAE,OAAO,eAAe;AAAA,QAC7B,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,UAAG,IAAI;AAAA,YAAE,OAAO;AAAA,YAAkB,YAAY;AAAA,UAAI;AAAA,UAAG,SAAQ;AAAA,UAC1D,UAAA;AAAA,QACA,CAAA,CACE;AAAA,MACH,CAAA,CAAA;AAAA;EACD,CAAA;AAEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransparentOverdraftV2';
|
|
@@ -19,6 +19,7 @@ export * from './P2pCategorization';
|
|
|
19
19
|
export * from './SavingsAccountBalancesSummary';
|
|
20
20
|
export * from './SetUpDirectDeposit';
|
|
21
21
|
export * from './SwitchDirectDeposit';
|
|
22
|
+
export * from './TransparentOverdraftV2';
|
|
22
23
|
export * from './UnifiedDeposit';
|
|
23
24
|
export * from './WeeklyNoSpendDays';
|
|
24
25
|
export * from './MarketingHub';
|
|
@@ -17,7 +17,7 @@ import { MiniInsightCard as U } from "./components/shared/MiniInsightCard.es.js"
|
|
|
17
17
|
import { MenuAction as H } from "./components/shared/MenuAction.es.js";
|
|
18
18
|
import w from "./components/shared/P2P/P2PMultipleCategorization.es.js";
|
|
19
19
|
import V from "./components/shared/SaveEnoughToLiveOnBottomSection.es.js";
|
|
20
|
-
import
|
|
20
|
+
import z from "./components/shared/SaveEnoughToLiveOnTopSection.es.js";
|
|
21
21
|
import W from "./components/shared/StatusIndicator.es.js";
|
|
22
22
|
import R from "./components/shared/TransactionCard.es.js";
|
|
23
23
|
import { DirectDeposit as X } from "./components/shared/DirectDeposit/DirectDeposit.es.js";
|
|
@@ -43,7 +43,7 @@ import { LinedCardZeroState as ko } from "./components/shared/ZeroState/LinedCar
|
|
|
43
43
|
import { ErrorCard as Eo } from "./components/shared/ErrorCard/ErrorCard.es.js";
|
|
44
44
|
import { FeedbackHeader as Lo } from "./components/shared/GenericFeedback/FeedbackHeader.es.js";
|
|
45
45
|
import { FeedbackButtons as xo } from "./components/shared/GenericFeedback/FeedbackButtons.es.js";
|
|
46
|
-
import { FeedbackDescription as
|
|
46
|
+
import { FeedbackDescription as Oo } from "./components/shared/GenericFeedback/FeedbackDescription.es.js";
|
|
47
47
|
import { FeedbackOptions as No } from "./components/shared/GenericFeedback/FeedbackOptions.es.js";
|
|
48
48
|
import { BeatFeedbackText as Go } from "./components/shared/GenericFeedback/FeedbackText.es.js";
|
|
49
49
|
import { AccountDiscoverability as jo } from "./components/insights/AccountDiscoverability/AccountDiscoverability.es.js";
|
|
@@ -70,7 +70,7 @@ import { MonthlyEmergencyFundReviewBody as kr } from "./components/insights/Mont
|
|
|
70
70
|
import { LastMonthsContributionSection as Er } from "./components/insights/MonthlyEmergencyFundReview/LastMonthsContributionSection.es.js";
|
|
71
71
|
import { ProjectedCompletionSection as Lr } from "./components/insights/MonthlyEmergencyFundReview/ProjectedCompletionSection.es.js";
|
|
72
72
|
import { TotalSavedSection as xr } from "./components/insights/MonthlyEmergencyFundReview/TotalSection.es.js";
|
|
73
|
-
import { MonthlySavingsToIncomeComparison as
|
|
73
|
+
import { MonthlySavingsToIncomeComparison as Or } from "./components/insights/MonthlySavingsToIncomeComparison/MonthlySavingsToIncomeComparison.es.js";
|
|
74
74
|
import { MonthlySpendingComparisonV2 as Nr } from "./components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js";
|
|
75
75
|
import { MonthlySpendToIncomeComparisonV2 as Gr } from "./components/insights/MonthlySpendToIncomeComparisonV2/MonthlySpendToIncomeComparisonV2.es.js";
|
|
76
76
|
import { P2pCategorization as jr } from "./components/insights/P2pCategorization/P2pCategorization.es.js";
|
|
@@ -81,14 +81,15 @@ import { SetUpDirectDepositBody as _r } from "./components/insights/SetUpDirectD
|
|
|
81
81
|
import { AccountBox as ot } from "./components/insights/SwitchDirectDeposit/AccountBox.es.js";
|
|
82
82
|
import { SwitchDirectDepositMainContainer as tt } from "./components/insights/SwitchDirectDeposit/SwitchDirectDepositMainContainer.es.js";
|
|
83
83
|
import { SwitchDirectDepositBody as mt } from "./components/insights/SwitchDirectDeposit/SwitchDirectDepositBody.es.js";
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
84
|
+
import { TransparentOverdraftV2 as at } from "./components/insights/TransparentOverdraftV2/TransparentOverdraftV2.es.js";
|
|
85
|
+
import { UnifiedDeposit as nt } from "./components/insights/UnifiedDeposit/UnifiedDeposit.es.js";
|
|
86
|
+
import { WeeklyNoSpendDays as dt } from "./components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js";
|
|
87
|
+
import { UserFeedback as st } from "./components/insights/UserFeedback/UserFeedback.es.js";
|
|
88
|
+
import { DirectDepositDeepLink as lt } from "./components/shared/DeepLinks/DirectDeposit/DirectDepositDeepLink.es.js";
|
|
89
|
+
import { Header as ut } from "./components/feed/Header.es.js";
|
|
90
|
+
import { P2PCategorizationSingleAccount as Bt } from "./components/shared/P2PCategorizationSingleAccount/P2PCategorizationSingleAccount.es.js";
|
|
91
|
+
import { DrillDownCalculation as ht, variants as yt } from "./components/shared/DrillDownCalculation/DrillDownCalculation.es.js";
|
|
92
|
+
import { SaveAnExtra100 as Tt } from "./components/shared/SaveAnExtra100/SaveAnExtra100.es.js";
|
|
92
93
|
export {
|
|
93
94
|
ot as AccountBox,
|
|
94
95
|
jo as AccountDiscoverability,
|
|
@@ -122,7 +123,7 @@ export {
|
|
|
122
123
|
sr as CustomTransaction,
|
|
123
124
|
Mo as Description,
|
|
124
125
|
X as DirectDeposit,
|
|
125
|
-
|
|
126
|
+
lt as DirectDepositDeepLink,
|
|
126
127
|
q as DirectDepositSubHeader,
|
|
127
128
|
ur as DiscoveredAccountsBody,
|
|
128
129
|
T as DiscoveredAccountsConnect,
|
|
@@ -130,7 +131,7 @@ export {
|
|
|
130
131
|
hr as DiscoveredAccountsMiniInsight,
|
|
131
132
|
f as DoubleBarChart,
|
|
132
133
|
c as DoubleBarChartMXUI,
|
|
133
|
-
|
|
134
|
+
ht as DrillDownCalculation,
|
|
134
135
|
vo as EmbeddedCard,
|
|
135
136
|
C as EmptyBarChart,
|
|
136
137
|
Eo as ErrorCard,
|
|
@@ -138,11 +139,11 @@ export {
|
|
|
138
139
|
vr as FederalBankHolidayMUI,
|
|
139
140
|
xo as FeedbackButtons,
|
|
140
141
|
Ao as FeedbackCard,
|
|
141
|
-
|
|
142
|
+
Oo as FeedbackDescription,
|
|
142
143
|
Lo as FeedbackHeader,
|
|
143
144
|
No as FeedbackOptions,
|
|
144
145
|
K as FullFeedBodyHeader,
|
|
145
|
-
|
|
146
|
+
ut as Header,
|
|
146
147
|
Fo as InsightButton,
|
|
147
148
|
Er as LastMonthsContributionSection,
|
|
148
149
|
Y as LeftBox,
|
|
@@ -153,11 +154,11 @@ export {
|
|
|
153
154
|
U as MiniInsightCard,
|
|
154
155
|
Fr as MonthlyDebtToIncomeComparisonV2,
|
|
155
156
|
kr as MonthlyEmergencyFundReviewBody,
|
|
156
|
-
|
|
157
|
+
Or as MonthlySavingsToIncomeComparison,
|
|
157
158
|
Gr as MonthlySpendToIncomeComparisonV2,
|
|
158
159
|
Nr as MonthlySpendingComparisonV2,
|
|
159
160
|
Ar as Offer,
|
|
160
|
-
|
|
161
|
+
Bt as P2PCategorizationSingleAccount,
|
|
161
162
|
w as P2PMultipleCategorization,
|
|
162
163
|
jr as P2pCategorization,
|
|
163
164
|
Zr as P2pCategorizationMultipleTransactions,
|
|
@@ -167,9 +168,9 @@ export {
|
|
|
167
168
|
I as PulseGraidentBox,
|
|
168
169
|
b as PulseProgressBar,
|
|
169
170
|
ro as RightBox,
|
|
170
|
-
|
|
171
|
+
Tt as SaveAnExtra100,
|
|
171
172
|
V as SaveEnoughToLiveOnBottomSection,
|
|
172
|
-
|
|
173
|
+
z as SaveEnoughToLiveOnTopSection,
|
|
173
174
|
Qr as SavingsAccountBalancesSummary,
|
|
174
175
|
_r as SetUpDirectDepositBody,
|
|
175
176
|
lr as SharedDeposit,
|
|
@@ -178,8 +179,9 @@ export {
|
|
|
178
179
|
tt as SwitchDirectDepositMainContainer,
|
|
179
180
|
xr as TotalSavedSection,
|
|
180
181
|
R as TransactionCard,
|
|
181
|
-
at as
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
at as TransparentOverdraftV2,
|
|
183
|
+
nt as UnifiedDeposit,
|
|
184
|
+
st as UserFeedback,
|
|
185
|
+
dt as WeeklyNoSpendDays,
|
|
186
|
+
yt as variants
|
|
185
187
|
};
|
|
@@ -1,125 +1,126 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import { DATE_FORMATS_INTL as
|
|
3
|
-
import { useCategoryStore as
|
|
4
|
-
import { ANALYTICS_EVENTS as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import he from "
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import Ie from "./transactiondetails/
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
1
|
+
import { buildDynamicCopy as F } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { DATE_FORMATS_INTL as re, formatDate as oe } from "../../../core/constants/DateFormats.es.js";
|
|
3
|
+
import { useCategoryStore as ie, useEvent as ae, useGlobalCopyStore as ne, useGlobalUiStore as de, useTransactionStore as se, useUserStore as le } from "../../../common/context/hooks.es.js";
|
|
4
|
+
import { ANALYTICS_EVENTS as me } from "../../../common/constants/Analytics.es.js";
|
|
5
|
+
import { TransactionType as ce } from "../../../core/types/Transaction.es.js";
|
|
6
|
+
import { isFeatureEnabled as ue } from "../../../core/utils/UserUtils.es.js";
|
|
7
|
+
import { formatCurrency as G } from "../../../core/utils/NumberFormatting.es.js";
|
|
8
|
+
import { fromUnixUTC as pe } from "../../../core/utils/DateUtil.es.js";
|
|
9
|
+
import ge from "../../../common/components/Loader.es.js";
|
|
10
|
+
import { BottomActions as m, DEFAULT_BOTTOM_ACTIONS as fe, DEFAULT_TOP_ACTIONS as he, TopActions as f } from "../../constants/Actions.es.js";
|
|
11
|
+
import _e from "../../../insights/components/shared/ChartTransactionWithDrillDown.es.js";
|
|
12
|
+
import { EmbeddedCard as Te } from "../../../insights/components/shared/InsightsCard/EmbeddedCard.es.js";
|
|
13
|
+
import { AddMerchantBudgetAction as Se } from "./transactiondetails/actions/AddMerchantBudgetAction.es.js";
|
|
14
|
+
import ye from "./transactiondetails/actions/CategoryAction.es.js";
|
|
15
|
+
import be from "./transactiondetails/actions/DateAction.es.js";
|
|
16
|
+
import De from "./transactiondetails/actions/DeleteAction.es.js";
|
|
17
|
+
import Ae from "./transactiondetails/actions/DeleteLogoAction.es.js";
|
|
18
|
+
import Ce from "./transactiondetails/actions/ExcludeAction.es.js";
|
|
19
|
+
import ve from "./transactiondetails/actions/MemoAction.es.js";
|
|
20
|
+
import xe from "./transactiondetails/actions/SplitAction.es.js";
|
|
21
|
+
import we from "./transactiondetails/actions/TagsAction.es.js";
|
|
22
|
+
import Ie from "./transactiondetails/Description.es.js";
|
|
23
|
+
import Le from "./transactiondetails/FlagTransaction.es.js";
|
|
24
|
+
import Ee from "./transactiondetails/TransactionDetailsView.es.js";
|
|
25
|
+
import { getEmbeddedInstanceSlotByBeatTemplates as Me } from "./getEmbeddedInstanceSlotByBeatTemplates.es.js";
|
|
26
|
+
import a, { useMemo as P } from "react";
|
|
27
|
+
import { observer as Oe } from "mobx-react-lite";
|
|
28
|
+
import h from "@mui/material/Stack";
|
|
29
|
+
import { MerchantLogo as U, P as Be, Text as b } from "@mxenabled/mxui";
|
|
30
|
+
import { endOfMonth as Ne } from "date-fns/endOfMonth";
|
|
31
|
+
import { isBefore as Fe } from "date-fns/isBefore";
|
|
32
|
+
import { startOfMonth as k } from "date-fns/startOfMonth";
|
|
32
33
|
import D from "@mui/material/Paper";
|
|
33
34
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
34
|
-
import { useTheme as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
var
|
|
41
|
-
const { onEvent: W } =
|
|
42
|
-
a.useEffect(() => W(
|
|
35
|
+
import { useTheme as Ge } from "@mui/material/styles";
|
|
36
|
+
import Pe from "@mui/material/Box";
|
|
37
|
+
import H from "@mui/material/Divider";
|
|
38
|
+
import R from "@mui/material/List";
|
|
39
|
+
import Ue from "@mui/material/Alert";
|
|
40
|
+
import ke from "@mui/material/Snackbar";
|
|
41
|
+
var He = ({ bottomActions: _ = fe, canFlagTransaction: V = !0, topActions: A = he, transaction: e }) => {
|
|
42
|
+
const { onEvent: W } = ae(), { isCopyLoaded: j } = de(), { userFeatures: z } = le(), { accounts: q, common: X, insights_feed: d } = ne(), { detailedCategories: C } = ie(), { alert: v, associatedBeats: x, detailedTransactions: w, cachedStartDate: I, loadEmbeddedInstanceTransactions: Y, setAlert: L } = se(), [$, E] = a.useState(!1), [M, O] = a.useState(!1), [J, K] = a.useState(!1), Q = Ge(), Z = e?.number && e.number.length > 4, B = e?.transaction_type === ce.CREDIT, s = a.useMemo(() => x.find((r) => r.associated_transaction_guid === e.guid), [x, e]), o = Me(X, s), [l, T] = a.useState(o ? o.dataSeries.length - 1 : 0);
|
|
43
|
+
a.useEffect(() => W(me.TRANSACTION_DETAILS_VIEW, { transaction_guid: e.guid }), []), a.useEffect(() => {
|
|
43
44
|
if (!o || o.dataSeries.length === 0) return;
|
|
44
|
-
const { date: r } = o.dataSeries[
|
|
45
|
-
|
|
45
|
+
const { date: r } = o.dataSeries[l], i = k(r);
|
|
46
|
+
Fe(i, I) && (O(!0), Y(i).finally(() => {
|
|
46
47
|
O(!1);
|
|
47
48
|
}));
|
|
48
49
|
}, [
|
|
49
|
-
|
|
50
|
+
l,
|
|
50
51
|
o,
|
|
51
|
-
|
|
52
|
+
I
|
|
52
53
|
]);
|
|
53
|
-
const S = _.includes(m.MerchantBudget) && !e?.merchant_guid ? _.filter((r) => r !== m.MerchantBudget) : _, y =
|
|
54
|
+
const S = _.includes(m.MerchantBudget) && !e?.merchant_guid ? _.filter((r) => r !== m.MerchantBudget) : _, y = P(() => {
|
|
54
55
|
if (o) {
|
|
55
|
-
const r = C.find((
|
|
56
|
-
let
|
|
57
|
-
return u - i < 0 && (
|
|
56
|
+
const r = C.find((g) => g.guid === e.top_level_category_guid), i = s?.payload?.average_amount ?? 0, u = e.amount;
|
|
57
|
+
let p = d.general.increased_text;
|
|
58
|
+
return u - i < 0 && (p = d.general.decreased_text), {
|
|
58
59
|
category: r,
|
|
59
60
|
percentageAmount: i === 0 ? 0 : Math.round(Math.abs(u - i) / i * 100),
|
|
60
|
-
changetype:
|
|
61
|
+
changetype: p
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
return null;
|
|
64
|
-
}, [o, C]),
|
|
65
|
+
}, [o, C]), ee = P(() => {
|
|
65
66
|
if (!o?.dataSeries?.length) return [];
|
|
66
|
-
const { guid: r, date: i } = o.dataSeries[
|
|
67
|
-
return
|
|
68
|
-
const
|
|
69
|
-
return
|
|
67
|
+
const { guid: r, date: i } = o.dataSeries[l], u = k(i), p = Ne(i);
|
|
68
|
+
return w.filter((g) => {
|
|
69
|
+
const N = pe(g.date);
|
|
70
|
+
return N >= u && N <= p && g.guid === r;
|
|
70
71
|
});
|
|
71
72
|
}, [
|
|
72
|
-
|
|
73
|
+
l,
|
|
73
74
|
o,
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
w,
|
|
76
|
+
M
|
|
76
77
|
]);
|
|
77
|
-
if (!
|
|
78
|
-
const c =
|
|
79
|
-
return /* @__PURE__ */ n(
|
|
78
|
+
if (!j) return /* @__PURE__ */ t(ge, {});
|
|
79
|
+
const c = ue(z, "MX_TXN_DETAILS_VIEW_ONLY"), te = Q.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
80
|
+
return /* @__PURE__ */ n(Pe, {
|
|
80
81
|
className: "mx-txn-transaction-details",
|
|
81
82
|
width: "100%",
|
|
82
83
|
children: [
|
|
83
|
-
e && /* @__PURE__ */ n(
|
|
84
|
-
/* @__PURE__ */ n(
|
|
84
|
+
e && /* @__PURE__ */ n(h, { children: [
|
|
85
|
+
/* @__PURE__ */ n(h, {
|
|
85
86
|
gap: 12,
|
|
86
87
|
p: 24,
|
|
87
88
|
children: [
|
|
88
89
|
/* @__PURE__ */ t(D, {
|
|
89
90
|
elevation: 2,
|
|
90
91
|
sx: { width: 64 },
|
|
91
|
-
children: /* @__PURE__ */ t(
|
|
92
|
+
children: /* @__PURE__ */ t(U, {
|
|
92
93
|
categoryGuid: e.top_level_category_guid || "",
|
|
93
94
|
merchantGuid: e.merchant_guid || "",
|
|
94
95
|
size: 64
|
|
95
96
|
})
|
|
96
97
|
}),
|
|
97
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(Ie, {
|
|
98
99
|
transaction: e,
|
|
99
100
|
viewOnly: c
|
|
100
101
|
}),
|
|
101
|
-
/* @__PURE__ */ n(
|
|
102
|
+
/* @__PURE__ */ n(h, {
|
|
102
103
|
direction: "row",
|
|
103
104
|
justifyContent: "space-between",
|
|
104
105
|
sx: { minHeight: 44 },
|
|
105
|
-
children: [/* @__PURE__ */ n(
|
|
106
|
-
color:
|
|
106
|
+
children: [/* @__PURE__ */ n(Be, {
|
|
107
|
+
color: B ? "success.main" : "text.primary",
|
|
107
108
|
variant: "h1",
|
|
108
|
-
children: [
|
|
109
|
-
}), !c && V && /* @__PURE__ */ t(
|
|
109
|
+
children: [B ? "+" : "", G(e.amount, "0,0.00")]
|
|
110
|
+
}), !c && V && /* @__PURE__ */ t(Le, { transaction: e })]
|
|
110
111
|
}),
|
|
111
|
-
o?.instanceSlot && /* @__PURE__ */ t(
|
|
112
|
+
o?.instanceSlot && /* @__PURE__ */ t(Te, {
|
|
112
113
|
callToAction: o.callToAction,
|
|
113
|
-
description:
|
|
114
|
+
description: F(d.general.embedded_description, y.changetype, /* @__PURE__ */ t("strong", { children: y.percentageAmount })),
|
|
114
115
|
instanceSlot: o.instanceSlot,
|
|
115
116
|
onCtaClick: () => {
|
|
116
|
-
|
|
117
|
+
E(!0);
|
|
117
118
|
},
|
|
118
|
-
title:
|
|
119
|
+
title: s.html_micro_title
|
|
119
120
|
}),
|
|
120
|
-
/* @__PURE__ */ n(
|
|
121
|
+
/* @__PURE__ */ n(h, {
|
|
121
122
|
sx: {
|
|
122
|
-
bgcolor:
|
|
123
|
+
bgcolor: te,
|
|
123
124
|
borderRadius: "4px",
|
|
124
125
|
gap: 4,
|
|
125
126
|
p: 8
|
|
@@ -127,7 +128,7 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
127
128
|
children: [/* @__PURE__ */ t(b, {
|
|
128
129
|
bold: !0,
|
|
129
130
|
children: `${e.account}
|
|
130
|
-
${
|
|
131
|
+
${Z ? e.number : "•".repeat(4).concat(e.number ?? "")}`
|
|
131
132
|
}), /* @__PURE__ */ t(b, {
|
|
132
133
|
bold: !0,
|
|
133
134
|
truncate: !0,
|
|
@@ -140,12 +141,12 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
140
141
|
/* @__PURE__ */ t(D, {
|
|
141
142
|
square: !0,
|
|
142
143
|
sx: { boxShadow: "none" },
|
|
143
|
-
children: c ? /* @__PURE__ */ t(
|
|
144
|
-
r ===
|
|
145
|
-
r ===
|
|
146
|
-
r ===
|
|
147
|
-
r ===
|
|
148
|
-
/* @__PURE__ */ t(
|
|
144
|
+
children: c ? /* @__PURE__ */ t(Ee, { transaction: e }) : /* @__PURE__ */ t(R, { children: A.map((r, i) => /* @__PURE__ */ n(a.Fragment, { children: [
|
|
145
|
+
r === f.Category && /* @__PURE__ */ t(ye, { transaction: e }),
|
|
146
|
+
r === f.Date && /* @__PURE__ */ t(be, { transaction: e }),
|
|
147
|
+
r === f.Memo && /* @__PURE__ */ t(ve, { transaction: e }),
|
|
148
|
+
r === f.Tags && /* @__PURE__ */ t(we, { transaction: e }),
|
|
149
|
+
/* @__PURE__ */ t(H, {
|
|
149
150
|
component: "li",
|
|
150
151
|
variant: i < A.length - 1 ? "inset" : "fullWidth"
|
|
151
152
|
})
|
|
@@ -157,28 +158,28 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
157
158
|
ml: 26,
|
|
158
159
|
mt: 16,
|
|
159
160
|
variant: "body1",
|
|
160
|
-
children:
|
|
161
|
+
children: q.actions
|
|
161
162
|
}), /* @__PURE__ */ t(D, {
|
|
162
163
|
square: !0,
|
|
163
164
|
sx: { boxShadow: "none" },
|
|
164
|
-
children: /* @__PURE__ */ n(
|
|
165
|
-
r === m.MerchantBudget && /* @__PURE__ */ t(
|
|
166
|
-
r === m.SplitTransaction && /* @__PURE__ */ t(
|
|
167
|
-
r === m.HideTransaction && /* @__PURE__ */ t(
|
|
168
|
-
r === m.MerchantLogo && /* @__PURE__ */ t(
|
|
169
|
-
/* @__PURE__ */ t(
|
|
165
|
+
children: /* @__PURE__ */ n(R, { children: [S.map((r, i) => /* @__PURE__ */ n(a.Fragment, { children: [
|
|
166
|
+
r === m.MerchantBudget && /* @__PURE__ */ t(Se, { transaction: e }),
|
|
167
|
+
r === m.SplitTransaction && /* @__PURE__ */ t(xe, { transaction: e }),
|
|
168
|
+
r === m.HideTransaction && /* @__PURE__ */ t(Ce, { transaction: e }),
|
|
169
|
+
r === m.MerchantLogo && /* @__PURE__ */ t(Ae, { transaction: e }),
|
|
170
|
+
/* @__PURE__ */ t(H, {
|
|
170
171
|
component: "li",
|
|
171
172
|
variant: i < S.length - 1 ? "inset" : "fullWidth"
|
|
172
173
|
})
|
|
173
|
-
] }, r)), e.is_manual && !e.parent_guid && !e.has_been_split && /* @__PURE__ */ t(
|
|
174
|
+
] }, r)), e.is_manual && !e.parent_guid && !e.has_been_split && /* @__PURE__ */ t(De, { transaction: e })] })
|
|
174
175
|
})] })
|
|
175
176
|
] }),
|
|
176
|
-
|
|
177
|
-
ariaLabel:
|
|
177
|
+
s && o && /* @__PURE__ */ t(_e, {
|
|
178
|
+
ariaLabel: oe(o?.dataSeries[l]?.date, re.MONTH),
|
|
178
179
|
barChartProps: {
|
|
179
180
|
amounts: {
|
|
180
|
-
average:
|
|
181
|
-
formattedAverage:
|
|
181
|
+
average: s.payload.average_amount,
|
|
182
|
+
formattedAverage: G(s.payload.average_amount, "0,0")
|
|
182
183
|
},
|
|
183
184
|
color: y.category?.color || "",
|
|
184
185
|
data: o.chartData,
|
|
@@ -196,7 +197,7 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
196
197
|
legendPosition: "top"
|
|
197
198
|
},
|
|
198
199
|
beat: {
|
|
199
|
-
heading:
|
|
200
|
+
heading: s.html_title,
|
|
200
201
|
subHeading: {
|
|
201
202
|
category_guid: e.category_guid ?? "",
|
|
202
203
|
merchant_guid: e.merchant_guid ?? "",
|
|
@@ -204,32 +205,32 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
204
205
|
}
|
|
205
206
|
},
|
|
206
207
|
data: o.chartData,
|
|
207
|
-
defaultSelectedIndex:
|
|
208
|
-
icon: /* @__PURE__ */ t(
|
|
208
|
+
defaultSelectedIndex: l,
|
|
209
|
+
icon: /* @__PURE__ */ t(U, {
|
|
209
210
|
alt: e.description ?? "",
|
|
210
211
|
categoryGuid: e.category_guid ?? "",
|
|
211
212
|
merchantGuid: e.merchant_guid ?? "",
|
|
212
213
|
size: 16
|
|
213
214
|
}),
|
|
214
|
-
isOpen:
|
|
215
|
+
isOpen: $,
|
|
215
216
|
onClose: () => {
|
|
216
|
-
|
|
217
|
+
E(!1), T(o.dataSeries.length - 1);
|
|
217
218
|
},
|
|
218
219
|
onTabChange: (r) => {
|
|
219
220
|
T(r);
|
|
220
221
|
},
|
|
221
|
-
tipSection:
|
|
222
|
-
message:
|
|
223
|
-
onDismiss: () =>
|
|
222
|
+
tipSection: J ? void 0 : {
|
|
223
|
+
message: F(d.general.tip_section_message, /* @__PURE__ */ t("strong", { children: d.general.tip_section_title }), /* @__PURE__ */ t("strong", { children: s.primary_transaction?.description })),
|
|
224
|
+
onDismiss: () => K(!0)
|
|
224
225
|
},
|
|
225
226
|
title: d.general.transaction_history_title,
|
|
226
227
|
transactionListProps: {
|
|
227
|
-
showLoader:
|
|
228
|
+
showLoader: M,
|
|
228
229
|
showInsights: !0,
|
|
229
|
-
transaction:
|
|
230
|
+
transaction: ee
|
|
230
231
|
}
|
|
231
232
|
}),
|
|
232
|
-
/* @__PURE__ */ t(
|
|
233
|
+
/* @__PURE__ */ t(ke, {
|
|
233
234
|
anchorOrigin: {
|
|
234
235
|
vertical: "bottom",
|
|
235
236
|
horizontal: "right"
|
|
@@ -237,7 +238,7 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
237
238
|
autoHideDuration: 3500,
|
|
238
239
|
onClose: () => L(""),
|
|
239
240
|
open: !!v,
|
|
240
|
-
children: /* @__PURE__ */ t(
|
|
241
|
+
children: /* @__PURE__ */ t(Ue, {
|
|
241
242
|
closeText: "",
|
|
242
243
|
onClose: () => L(""),
|
|
243
244
|
severity: "success",
|
|
@@ -247,9 +248,9 @@ var Ue = ({ bottomActions: _ = ge, canFlagTransaction: V = !0, topActions: A = p
|
|
|
247
248
|
})
|
|
248
249
|
]
|
|
249
250
|
});
|
|
250
|
-
},
|
|
251
|
+
}, wt = Oe(He);
|
|
251
252
|
export {
|
|
252
|
-
|
|
253
|
+
wt as default
|
|
253
254
|
};
|
|
254
255
|
|
|
255
256
|
//# sourceMappingURL=TransactionDetails.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { Transaction } from '../../../core'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n}\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n}) => {\n const { onEvent } = useEvent()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n const embeddedData = getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Paper elevation={2} sx={{ width: 64 }}>\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={64}\n />\n </Paper>\n\n <Description transaction={transaction} viewOnly={shouldShowViewOnlyMode} />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={transaction.isIncome ? 'success.main' : 'text.primary'} variant=\"h1\">\n {transaction.isIncome ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>\n {`${transaction.account}\n ${\n showFullNumber\n ? transaction.number\n : '\\u2022'.repeat(4).concat(transaction.number ?? '')\n }`}\n </Text>\n <Text bold={true} truncate={true} variant=\"tiny\">\n {transaction.feed_description}\n </Text>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,IAAM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,cAAA,EAAA,IAAiB,GAAiB,GACpC,EAAE,cA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,EAAC,IAAD;AAAA,QACE,cAAc;AAAA,UAAE,UAAU;AAAA,UAAU,YAAY;AAAA,QAAQ;AAAA,QACxD,kBAAkB;AAAA,QAClB,SAAA,MAAe,EAAS,EAAE;AAAA,QAC1B,MAAM,EAAQ;AAAA,QAEd,UAAA,gBAAA,EAAC,IAAD;AAAA,UAAO,WAAU;AAAA,UAAG,SAAA,MAAe,EAAS,EAAE;AAAA,UAAG,UAAS;AAAA,UAAU,SAAQ;AAAA,UACzE,UAAA;AAAA,QACI,CAAA;AAAA,MACC,CAAA;AAAA,IACP;AAAA;AAET,GAEA,KAAe,GAAS,EAAkB"}
|
|
1
|
+
{"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { Transaction, TransactionType } from '../../../core'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n}\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n}) => {\n const { onEvent } = useEvent()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n const embeddedData = getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Paper elevation={2} sx={{ width: 64 }}>\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={64}\n />\n </Paper>\n\n <Description transaction={transaction} viewOnly={shouldShowViewOnlyMode} />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>\n {`${transaction.account}\n ${\n showFullNumber\n ? transaction.number\n : '\\u2022'.repeat(4).concat(transaction.number ?? '')\n }`}\n </Text>\n <Text bold={true} truncate={true} variant=\"tiny\">\n {transaction.feed_description}\n </Text>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,IAAM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,cAAA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,UACd,aAAa;AAAA,QACf;AAAA,MACD,CAAA;AAAA,MAEH,gBAAA,EAAC,IAAD;AAAA,QACE,cAAc;AAAA,UAAE,UAAU;AAAA,UAAU,YAAY;AAAA,QAAQ;AAAA,QACxD,kBAAkB;AAAA,QAClB,SAAA,MAAe,EAAS,EAAE;AAAA,QAC1B,MAAM,EAAQ;AAAA,QAEd,UAAA,gBAAA,EAAC,IAAD;AAAA,UAAO,WAAU;AAAA,UAAG,SAAA,MAAe,EAAS,EAAE;AAAA,UAAG,UAAS;AAAA,UAAU,SAAQ;AAAA,UACzE,UAAA;AAAA,QACI,CAAA;AAAA,MACC,CAAA;AAAA,IACP;AAAA;AAET,GAEA,KAAe,GAAS,EAAkB"}
|
package/dist/transactions/components/shared/transactiondetails/TransactionAmountHeader.es.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
+
import { TransactionType as p } from "../../../../core/types/Transaction.es.js";
|
|
1
2
|
import { formatCurrency as u } from "../../../../core/utils/NumberFormatting.es.js";
|
|
2
3
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import { MerchantLogo as
|
|
4
|
+
import e from "@mui/material/Stack";
|
|
5
|
+
import { MerchantLogo as l, P as h, Text as f } from "@mxenabled/mxui";
|
|
5
6
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
const { amount: i, description: n,
|
|
8
|
-
return /* @__PURE__ */ r(
|
|
7
|
+
var C = ({ transaction: a }) => {
|
|
8
|
+
const { amount: i, description: n, merchant_guid: c, payee: m, top_level_category_guid: d, transaction_type: s } = a, t = s === p.CREDIT;
|
|
9
|
+
return /* @__PURE__ */ r(e, {
|
|
9
10
|
className: "mx-txn-amount-header",
|
|
10
11
|
direction: "row",
|
|
11
12
|
gap: 12,
|
|
12
13
|
px: 16,
|
|
13
14
|
py: 24,
|
|
14
|
-
children: [/* @__PURE__ */ o(
|
|
15
|
+
children: [/* @__PURE__ */ o(l, {
|
|
15
16
|
categoryGuid: d || "",
|
|
16
17
|
merchantGuid: c || "",
|
|
17
18
|
size: 64
|
|
18
|
-
}), /* @__PURE__ */ r(
|
|
19
|
+
}), /* @__PURE__ */ r(e, {
|
|
19
20
|
overflow: "hidden",
|
|
20
|
-
children: [/* @__PURE__ */ o(
|
|
21
|
+
children: [/* @__PURE__ */ o(f, {
|
|
21
22
|
bold: !0,
|
|
22
23
|
mb: 4,
|
|
23
24
|
truncate: !0,
|
|
24
25
|
variant: "body1",
|
|
25
26
|
children: n || m
|
|
26
|
-
}), /* @__PURE__ */ r(
|
|
27
|
-
color:
|
|
27
|
+
}), /* @__PURE__ */ r(h, {
|
|
28
|
+
color: t ? "success.main" : "text.primary",
|
|
28
29
|
truncate: !0,
|
|
29
30
|
variant: "h1",
|
|
30
|
-
children: [
|
|
31
|
+
children: [t ? "+" : "", u(i, "0,0.00")]
|
|
31
32
|
})]
|
|
32
33
|
})]
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
C as default
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
//# sourceMappingURL=TransactionAmountHeader.es.js.map
|
package/dist/transactions/components/shared/transactiondetails/TransactionAmountHeader.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionAmountHeader.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactiondetails/TransactionAmountHeader.tsx"],"sourcesContent":["import React from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport type
|
|
1
|
+
{"version":3,"file":"TransactionAmountHeader.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactiondetails/TransactionAmountHeader.tsx"],"sourcesContent":["import React from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { type Transaction, TransactionType } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\ninterface TransactionAmountHeaderProps {\n transaction: Transaction\n}\n\nconst TransactionAmountHeader: React.FC<TransactionAmountHeaderProps> = ({ transaction }) => {\n const { amount, description, merchant_guid, payee, top_level_category_guid, transaction_type } =\n transaction\n\n const isCredit = transaction_type === TransactionType.CREDIT\n\n return (\n <Stack className=\"mx-txn-amount-header\" direction=\"row\" gap={12} px={16} py={24}>\n <MerchantLogo\n categoryGuid={top_level_category_guid || ''}\n merchantGuid={merchant_guid || ''}\n size={64}\n />\n <Stack overflow=\"hidden\">\n <Text bold={true} mb={4} truncate={true} variant=\"body1\">\n {description || payee}\n </Text>\n <P color={isCredit ? 'success.main' : 'text.primary'} truncate={true} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(amount, '0,0.00')}\n </P>\n </Stack>\n </Stack>\n )\n}\n\nexport default TransactionAmountHeader\n"],"mappings":";;;;;;AAaA,IAAM,IAAA,CAAmE,EAAE,aAAA,EAAA,MAAkB;AAC3F,QAAM,EAAE,QAAA,GAAQ,aAAA,GAAa,eAAA,GAAe,OAAA,GAAO,yBAAA,GAAyB,kBAAA,EAAA,IAC1E,GAEI,IAAW,MAAqB,EAAgB;AAEtD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,WAAU;AAAA,IAAuB,WAAU;AAAA,IAAM,KAAK;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,IAA7E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,cAAc,KAA2B;AAAA,MACzC,cAAc,KAAiB;AAAA,MAC/B,MAAM;AAAA,IACP,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MAAO,UAAS;AAAA,MAAhB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI;AAAA,QAAG,UAAU;AAAA,QAAM,SAAQ;AAAA,QAC9C,UAAA,KAAe;AAAA,MACZ,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAG,OAAO,IAAW,iBAAiB;AAAA,QAAgB,UAAU;AAAA,QAAM,SAAQ;AAAA,QAA9E,UAAA,CACG,IAAW,MAAM,IACjB,EAAe,GAAQ,QAAQ,CAC/B;AAAA,MACE,CAAA,CAAA;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { DATE_FORMATS_INTL as p, formatDate as g } from "../../../../core/constants/DateFormats.es.js";
|
|
2
2
|
import { useGlobalCopyStore as u, useTransactionStore as f } from "../../../../common/context/hooks.es.js";
|
|
3
|
-
import { fromUnixUTC as
|
|
3
|
+
import { fromUnixUTC as _ } from "../../../../core/utils/DateUtil.es.js";
|
|
4
4
|
import c from "react";
|
|
5
|
-
import { observer as
|
|
5
|
+
import { observer as y } from "mobx-react-lite";
|
|
6
6
|
import { CategoryIcon as h, CategoryIconVariants as x, Icon as s, Text as i } from "@mxenabled/mxui";
|
|
7
7
|
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
import v from "@mui/material/Divider";
|
|
9
9
|
import b from "@mui/material/List";
|
|
10
10
|
import T from "@mui/material/ListItem";
|
|
11
11
|
import I from "@mui/material/ListItemText";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import L from "@mui/material/Avatar";
|
|
13
|
+
import A from "@mui/material/ListItemAvatar";
|
|
14
14
|
var m = (t, e, o, l = !0, n = "inset") => l ? /* @__PURE__ */ d(c.Fragment, { children: [/* @__PURE__ */ d(T, {
|
|
15
15
|
disableGutters: !0,
|
|
16
16
|
disablePadding: !0,
|
|
17
|
-
children: [/* @__PURE__ */ r(
|
|
17
|
+
children: [/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(L, {
|
|
18
18
|
sx: { bgcolor: "neutral.light" },
|
|
19
19
|
variant: "rounded",
|
|
20
20
|
children: t
|
|
@@ -27,7 +27,7 @@ var m = (t, e, o, l = !0, n = "inset") => l ? /* @__PURE__ */ d(c.Fragment, { ch
|
|
|
27
27
|
fontWeight: "normal"
|
|
28
28
|
} }
|
|
29
29
|
})]
|
|
30
|
-
}), /* @__PURE__ */ r(v, { variant: n })] }) : null,
|
|
30
|
+
}), /* @__PURE__ */ r(v, { variant: n })] }) : null, D = ({ transaction: t }) => {
|
|
31
31
|
const { transactions: e } = u(), { tags: o } = f(), l = c.useMemo(() => {
|
|
32
32
|
const n = new Map(o.map((a) => [a.guid, a.name]));
|
|
33
33
|
return t.tags.map((a) => n.get(a)).filter(Boolean).join(" / ");
|
|
@@ -54,7 +54,7 @@ var m = (t, e, o, l = !0, n = "inset") => l ? /* @__PURE__ */ d(c.Fragment, { ch
|
|
|
54
54
|
}), e.date_title, /* @__PURE__ */ r(i, {
|
|
55
55
|
bold: !0,
|
|
56
56
|
variant: "body1",
|
|
57
|
-
children: g(
|
|
57
|
+
children: g(_(t.date), p.FULL_MONTH_DAY_YEAR)
|
|
58
58
|
})),
|
|
59
59
|
m(/* @__PURE__ */ r(s, {
|
|
60
60
|
name: "article",
|
|
@@ -74,9 +74,9 @@ var m = (t, e, o, l = !0, n = "inset") => l ? /* @__PURE__ */ d(c.Fragment, { ch
|
|
|
74
74
|
}), !!t.tags?.length, "fullWidth")
|
|
75
75
|
]
|
|
76
76
|
});
|
|
77
|
-
},
|
|
77
|
+
}, z = y(D);
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
z as default
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
//# sourceMappingURL=TransactionDetailsView.es.js.map
|
package/dist/transactions/components/shared/transactiondetails/TransactionDetailsView.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetailsView.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactiondetails/TransactionDetailsView.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Avatar from '@mui/material/Avatar'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemText from '@mui/material/ListItemText'\n\nimport { CategoryIcon, CategoryIconVariants, Icon, Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore, useTransactionStore } from '../../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport { fromUnixUTC } from '../../../../core/utils/DateUtil'\nimport { type Transaction } from '../../../../core'\n\ninterface TransactionDetailsViewProps {\n transaction: Transaction\n}\n\nconst renderItem = (\n icon: React.ReactNode,\n primary: string,\n secondary: React.ReactNode,\n show: boolean = true,\n dividerVariant: 'inset' | 'fullWidth' = 'inset',\n) => {\n if (!show) return null\n return (\n <React.Fragment>\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: 'neutral.light' }} variant=\"rounded\">\n {icon}\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={primary}\n secondary={secondary}\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n </ListItem>\n <Divider variant={dividerVariant} />\n </React.Fragment>\n )\n}\n\nconst TransactionDetailsView = ({ transaction }: TransactionDetailsViewProps) => {\n const { transactions: copy } = useGlobalCopyStore()\n const { tags } = useTransactionStore()\n\n const tagNames = React.useMemo(() => {\n const tagMap = new Map(tags.map((tag) => [tag.guid, tag.name]))\n\n return transaction.tags\n .map((tagGuid) => tagMap.get(tagGuid))\n .filter(Boolean)\n .join(' / ')\n }, [tags, transaction.tags])\n\n return (\n <List sx={{ '& .MuiListItem-root': { px: 24, py: 12 } }}>\n {renderItem(\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n size={24}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />,\n copy.category_title,\n <Text bold={true} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\n </Text>,\n )}\n\n {renderItem(\n <Icon name=\"calendar_month\" sx={{ color: 'text.primary' }} />,\n copy.date_title,\n <Text bold={true} variant=\"body1\">\n {formatDate(fromUnixUTC(transaction.date), DATE_FORMATS_INTL.
|
|
1
|
+
{"version":3,"file":"TransactionDetailsView.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactiondetails/TransactionDetailsView.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Avatar from '@mui/material/Avatar'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemText from '@mui/material/ListItemText'\n\nimport { CategoryIcon, CategoryIconVariants, Icon, Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore, useTransactionStore } from '../../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport { fromUnixUTC } from '../../../../core/utils/DateUtil'\nimport { type Transaction } from '../../../../core'\n\ninterface TransactionDetailsViewProps {\n transaction: Transaction\n}\n\nconst renderItem = (\n icon: React.ReactNode,\n primary: string,\n secondary: React.ReactNode,\n show: boolean = true,\n dividerVariant: 'inset' | 'fullWidth' = 'inset',\n) => {\n if (!show) return null\n return (\n <React.Fragment>\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: 'neutral.light' }} variant=\"rounded\">\n {icon}\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={primary}\n secondary={secondary}\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n </ListItem>\n <Divider variant={dividerVariant} />\n </React.Fragment>\n )\n}\n\nconst TransactionDetailsView = ({ transaction }: TransactionDetailsViewProps) => {\n const { transactions: copy } = useGlobalCopyStore()\n const { tags } = useTransactionStore()\n\n const tagNames = React.useMemo(() => {\n const tagMap = new Map(tags.map((tag) => [tag.guid, tag.name]))\n\n return transaction.tags\n .map((tagGuid) => tagMap.get(tagGuid))\n .filter(Boolean)\n .join(' / ')\n }, [tags, transaction.tags])\n\n return (\n <List sx={{ '& .MuiListItem-root': { px: 24, py: 12 } }}>\n {renderItem(\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n size={24}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />,\n copy.category_title,\n <Text bold={true} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\n </Text>,\n )}\n\n {renderItem(\n <Icon name=\"calendar_month\" sx={{ color: 'text.primary' }} />,\n copy.date_title,\n <Text bold={true} variant=\"body1\">\n {formatDate(fromUnixUTC(transaction.date), DATE_FORMATS_INTL.FULL_MONTH_DAY_YEAR)}\n </Text>,\n )}\n\n {renderItem(\n <Icon name=\"article\" sx={{ color: 'text.primary' }} />,\n copy.memo_title,\n <Text bold={true} variant=\"body1\">\n {transaction.memo ?? copy.memo_desc}\n </Text>,\n Boolean(transaction.memo),\n transaction.tags?.length > 0 ? 'inset' : 'fullWidth',\n )}\n\n {renderItem(\n <Icon name=\"local_offer\" sx={{ color: 'text.primary' }} />,\n copy.tags_title,\n <Text bold={true} variant=\"body1\">\n {transaction.tags?.length ? tagNames : copy.tags_desc}\n </Text>,\n Boolean(transaction.tags?.length),\n 'fullWidth',\n )}\n </List>\n )\n}\n\nexport default observer(TransactionDetailsView)\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,IAAA,CACJ,GACA,GACA,GACA,IAAgB,IAChB,IAAwC,YAEnC,IAEH,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,EAAU,gBAAgB;AAAA,EAAM,gBAAgB;AAAA,EAAhD,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,IAAQ,IAAI,EAAE,SAAS,gBAAgB;AAAA,IAAG,SAAQ;AAAA,IAC/C,UAAA;AAAA,EACK,CAAA,EACM,CAAA,GAChB,gBAAA,EAAC,GAAD;AAAA,IACW,SAAA;AAAA,IACE,WAAA;AAAA,IACX,WAAW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EAAW,EAAY,EAAY,IAAI,GAAG,EAAkB,mBAAmB;AAAA,MAC5E,CAAA,CACR;AAAA,MAEC,EACC,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAK;AAAA,QAAU,IAAI,EAAE,OAAO,eAAe;AAAA,MAAI,CAAA,GACrD,EAAK,YACL,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,SAAQ;AAAA,QACvB,UAAA,EAAY,QAAQ,EAAK;AAAA,MACtB,CAAA,GACN,EAAQ,EAAY,MACpB,EAAY,MAAM,SAAS,IAAI,UAAU,WAC3C;AAAA,MAEC,EACC,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAK;AAAA,QAAc,IAAI,EAAE,OAAO,eAAe;AAAA,MAAI,CAAA,GACzD,EAAK,YACL,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,SAAQ;AAAA,QACvB,UAAA,EAAY,MAAM,SAAS,IAAW,EAAK;AAAA,MACxC,CAAA,GACN,EAAQ,EAAY,MAAM,QAC1B,WACF;AAAA,IACI;AAAA;AAEV,GAEA,IAAe,EAAS,CAAsB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DATE_FORMATS_INTL as S, formatDate as C } from "../../../../../core/constants/DateFormats.es.js";
|
|
2
2
|
import I, { CalendarSelectionTypes as h } from "../../../../../common/components/calendar/Calendar.es.js";
|
|
3
|
-
import { useEvent as g, useGlobalCopyStore as
|
|
4
|
-
import
|
|
3
|
+
import { useEvent as g, useGlobalCopyStore as L, useTransactionStore as v } from "../../../../../common/context/hooks.es.js";
|
|
4
|
+
import D from "../../../../../common/components/drawer/Drawer.es.js";
|
|
5
5
|
import { ANALYTICS_EVENTS as N } from "../../../../../common/constants/Analytics.es.js";
|
|
6
6
|
import { fromUnixUTC as m } from "../../../../../core/utils/DateUtil.es.js";
|
|
7
7
|
import { useTransactionsUiStore as b } from "../../../../context/hooks.es.js";
|
|
@@ -11,8 +11,8 @@ import O from "@mui/material/Stack";
|
|
|
11
11
|
import { Text as R } from "@mxenabled/mxui";
|
|
12
12
|
import { Icon as c } from "@mxenabled/mx-icons";
|
|
13
13
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
14
|
-
import { useTheme as
|
|
15
|
-
import { getUnixTime as
|
|
14
|
+
import { useTheme as U } from "@mui/material/styles";
|
|
15
|
+
import { getUnixTime as k } from "date-fns/getUnixTime";
|
|
16
16
|
import K from "@mui/material/ListItem";
|
|
17
17
|
import M from "@mui/material/ListItemButton";
|
|
18
18
|
import P from "@mui/material/ListItemText";
|
|
@@ -20,8 +20,8 @@ import Y from "@mui/material/Avatar";
|
|
|
20
20
|
import j from "@mui/material/ListItemAvatar";
|
|
21
21
|
import w from "@mui/material/ListItemIcon";
|
|
22
22
|
var st = ({ transaction: e }) => {
|
|
23
|
-
const { onEvent: n } = g(), { updateTransaction: d } =
|
|
24
|
-
T(
|
|
23
|
+
const { onEvent: n } = g(), { updateTransaction: d } = v(), { updateManualTransaction: p } = b(), { common: r, transactions: o } = L(), f = U(), [_, a] = s.useState(!1), [i, T] = s.useState(e.date), u = (A) => {
|
|
24
|
+
T(k(A));
|
|
25
25
|
}, y = async () => {
|
|
26
26
|
if (e.is_manual && !e.guid) {
|
|
27
27
|
p({
|
|
@@ -58,7 +58,7 @@ var st = ({ transaction: e }) => {
|
|
|
58
58
|
bold: !0,
|
|
59
59
|
sx: { color: "text.primary" },
|
|
60
60
|
variant: "body1",
|
|
61
|
-
children: C(m(e.date), S.
|
|
61
|
+
children: C(m(e.date), S.FULL_MONTH_DAY_YEAR)
|
|
62
62
|
}),
|
|
63
63
|
slotProps: { primary: {
|
|
64
64
|
variant: "caption",
|
|
@@ -71,7 +71,7 @@ var st = ({ transaction: e }) => {
|
|
|
71
71
|
sx: { color: "text.primary" }
|
|
72
72
|
}) })
|
|
73
73
|
]
|
|
74
|
-
}), /* @__PURE__ */ t(
|
|
74
|
+
}), /* @__PURE__ */ t(D, {
|
|
75
75
|
ariaLabelClose: r.close_aria,
|
|
76
76
|
isOpen: _,
|
|
77
77
|
onClose: () => a(!1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/DateAction.tsx"],"sourcesContent":["import React from 'react'\nimport { getUnixTime } from 'date-fns/getUnixTime'\n\nimport Avatar from '@mui/material/Avatar'\nimport Stack from '@mui/material/Stack'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport {\n ANALYTICS_EVENTS,\n Calendar,\n CalendarSelectionTypes,\n Drawer,\n useEvent,\n useGlobalCopyStore,\n useTransactionStore,\n} from '../../../../../common'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../../core/constants'\nimport { fromUnixUTC } from '../../../../../core/utils/DateUtil'\nimport type { Transaction } from '../../../../../core'\n\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\n\ninterface DateActionProps {\n transaction: Transaction\n}\n\nconst DateAction: React.FC<DateActionProps> = ({ transaction }) => {\n const { onEvent } = useEvent()\n const { updateTransaction } = useTransactionStore()\n const { updateManualTransaction } = useTransactionsUiStore()\n const { common: commonCopy, transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n const [open, setOpen] = React.useState(false)\n const [date, setDate] = React.useState<number>(transaction.date)\n\n const handleDateSelected = (date: Date) => {\n setDate(getUnixTime(date))\n }\n\n const handleSave = async () => {\n if (transaction.is_manual && !transaction.guid) {\n updateManualTransaction({ ...transaction, date })\n setOpen(false)\n return\n }\n\n await updateTransaction({ ...transaction, date })\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: transaction.guid })\n setOpen(false)\n }\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem className=\"mx-txn-date-action\" disableGutters={true} disablePadding={true}>\n <ListItemButton\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_DATE_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <Icon name=\"calendar_month\" sx={{ color: 'text.primary' }} />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.date_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {formatDate(fromUnixUTC(transaction.date), DATE_FORMATS_INTL.
|
|
1
|
+
{"version":3,"file":"DateAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/DateAction.tsx"],"sourcesContent":["import React from 'react'\nimport { getUnixTime } from 'date-fns/getUnixTime'\n\nimport Avatar from '@mui/material/Avatar'\nimport Stack from '@mui/material/Stack'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport {\n ANALYTICS_EVENTS,\n Calendar,\n CalendarSelectionTypes,\n Drawer,\n useEvent,\n useGlobalCopyStore,\n useTransactionStore,\n} from '../../../../../common'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../../core/constants'\nimport { fromUnixUTC } from '../../../../../core/utils/DateUtil'\nimport type { Transaction } from '../../../../../core'\n\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\n\ninterface DateActionProps {\n transaction: Transaction\n}\n\nconst DateAction: React.FC<DateActionProps> = ({ transaction }) => {\n const { onEvent } = useEvent()\n const { updateTransaction } = useTransactionStore()\n const { updateManualTransaction } = useTransactionsUiStore()\n const { common: commonCopy, transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n const [open, setOpen] = React.useState(false)\n const [date, setDate] = React.useState<number>(transaction.date)\n\n const handleDateSelected = (date: Date) => {\n setDate(getUnixTime(date))\n }\n\n const handleSave = async () => {\n if (transaction.is_manual && !transaction.guid) {\n updateManualTransaction({ ...transaction, date })\n setOpen(false)\n return\n }\n\n await updateTransaction({ ...transaction, date })\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: transaction.guid })\n setOpen(false)\n }\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem className=\"mx-txn-date-action\" disableGutters={true} disablePadding={true}>\n <ListItemButton\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_DATE_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <Icon name=\"calendar_month\" sx={{ color: 'text.primary' }} />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.date_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {formatDate(fromUnixUTC(transaction.date), DATE_FORMATS_INTL.FULL_MONTH_DAY_YEAR)}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={open}\n onClose={() => setOpen(false)}\n onPrimaryAction={handleSave}\n primaryText={commonCopy.save_button}\n secondaryText={commonCopy.cancel_button}\n title={copy.date_edit_title}\n >\n <Stack alignItems=\"center\" mt={40}>\n <Calendar\n beginDate={fromUnixUTC(date)}\n copy={{\n nextAria: copy.date_next_aria,\n prevAria: copy.date_prev_aria,\n today: commonCopy.date_range_picker.today,\n }}\n onDateSelected={handleDateSelected}\n selectionType={CalendarSelectionTypes.Single}\n />\n </Stack>\n </Drawer>\n </ListItem>\n )\n}\n\nexport default DateAction\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoCA,IAAM,KAAA,CAAyC,EAAE,aAAA,EAAA,MAAkB;AACjE,QAAM,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,mBAAA,EAAA,IAAsB,EAAoB,GAC5C,EAAE,yBAAA,EAAA,IAA4B,EAAuB,GACrD,EAAE,QAAQ,GAAY,cAAc,EAAA,IAAS,EAAmB,GAEhE,IAAQ,EAAS,GACjB,CAAC,GAAM,CAAA,IAAW,EAAM,SAAS,EAAK,GACtC,CAAC,GAAM,CAAA,IAAW,EAAM,SAAiB,EAAY,IAAI,GAEzD,IAAA,CAAsB,MAAe;AACzC,IAAA,EAAQ,EAAY,CAAI,CAAC;AAAA,EAC3B,GAEM,IAAa,YAAY;AAC7B,QAAI,EAAY,aAAa,CAAC,EAAY,MAAM;AAC9C,MAAA,EAAwB;AAAA,QAAE,GAAG;AAAA,QAAa,MAAA;AAAA,MAAK,CAAC,GAChD,EAAQ,EAAK;AACb;AAAA,IACF;AAEA,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,MAAA;AAAA,IAAK,CAAC,GAChD,EAAQ,EAAiB,gCAAgC,EAAE,kBAAkB,EAAY,KAAK,CAAC,GAC/F,EAAQ,EAAK;AAAA,EACf,GAEM,IAAU,EAAM,QAAQ,SAAS,SAAS,aAAa;AAE7D,SACE,gBAAA,EAAC,GAAD;AAAA,IAAU,WAAU;AAAA,IAAqB,gBAAgB;AAAA,IAAM,gBAAgB;AAAA,IAA/E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,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