@mx-cartographer/experiences 9.7.182 → 9.7.184
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/types/localization/CommonCopy.d.ts +1 -0
- package/dist/core/utils/TransactionUtils.d.ts +1 -0
- package/dist/core/utils/TransactionUtils.es.js +96 -95
- package/dist/core/utils/TransactionUtils.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.es.js +20 -20
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +27 -27
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +46 -28
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +13 -16
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +28 -27
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
- package/dist/transactions/components/shared/TransactionList.es.js +58 -57
- package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionTable.es.js +57 -49
- package/dist/transactions/components/shared/TransactionTable.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/DateCell.d.ts +4 -2
- package/dist/transactions/components/shared/transactiontable/cells/DateCell.es.js +14 -9
- package/dist/transactions/components/shared/transactiontable/cells/DateCell.es.js.map +1 -1
- package/dist/transactions/utils/Transactions.d.ts +1 -1
- package/dist/transactions/utils/Transactions.es.js +15 -23
- package/dist/transactions/utils/Transactions.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { useEvent as
|
|
2
|
-
import { ANALYTICS_EVENTS as
|
|
3
|
-
import
|
|
4
|
-
import { useTransactionsUiStore as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
1
|
+
import { useEvent as y, useGlobalCopyStore as N, useGlobalUiStore as T, useTransactionStore as v } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { ANALYTICS_EVENTS as A } from "../../../common/constants/Analytics.es.js";
|
|
3
|
+
import E from "../../../common/components/Loader.es.js";
|
|
4
|
+
import { useTransactionsUiStore as H } from "../../context/hooks.es.js";
|
|
5
|
+
import O from "./transactiontable/cells/AccountCell.es.js";
|
|
6
|
+
import L from "./transactiontable/cells/AmountCell.es.js";
|
|
7
|
+
import P from "./transactiontable/cells/CategoryCell.es.js";
|
|
8
|
+
import k from "./transactiontable/cells/DateCell.es.js";
|
|
9
|
+
import R from "./transactiontable/cells/FlagCell.es.js";
|
|
10
|
+
import n from "./transactiontable/cells/HeaderCell.es.js";
|
|
11
11
|
import D from "./transactiontable/cells/PayeeCell.es.js";
|
|
12
|
-
import
|
|
13
|
-
import { observer as
|
|
14
|
-
import
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { DataGridPro as
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
d
|
|
20
|
-
|
|
12
|
+
import f from "react";
|
|
13
|
+
import { observer as F } from "mobx-react-lite";
|
|
14
|
+
import G from "@mui/material/Paper";
|
|
15
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
16
|
+
import { DataGridPro as I, gridStringOrNumberComparator as B } from "@mui/x-data-grid-pro";
|
|
17
|
+
var g = ({ api: a, id: l }) => !!a.getRow(l)?.isPending, i = (a) => {
|
|
18
|
+
const l = a === "desc" ? -1 : 1;
|
|
19
|
+
return (s, c, r, d) => Number(g(d)) - Number(g(r)) || l * B(s, c, r, d);
|
|
20
|
+
}, K = ({ height: a = "100dvh", onCategoryClick: l, onRowClick: s }) => {
|
|
21
|
+
const { onEvent: c } = y(), { transactions: r } = N(), { isCopyLoaded: d } = T(), { isLoading: C, sortedTransactions: m } = v(), { clearExpandedSplits: p, toggleSplit: h } = H();
|
|
22
|
+
f.useEffect(() => () => p(), []);
|
|
23
|
+
const _ = f.useMemo(() => m.map((e) => ({
|
|
21
24
|
id: e.guid,
|
|
22
25
|
isHovering: !1,
|
|
23
26
|
...e
|
|
24
|
-
})), [
|
|
25
|
-
t.key !== "Enter" && t.key !== " " ||
|
|
27
|
+
})), [m]), u = ({ row: { id: e, guid: t, has_been_split: S }, field: b }) => S ? h(e) : b === "category" ? (c(A.TRANSACTIONS_TABLE_CLICK_CATEGORY, { guid: t }), l?.(t)) : s?.(t), w = (e, t) => {
|
|
28
|
+
t.key !== "Enter" && t.key !== " " || u(e);
|
|
26
29
|
};
|
|
27
|
-
if (!
|
|
30
|
+
if (!d) return /* @__PURE__ */ o(E, {});
|
|
28
31
|
const x = [
|
|
29
32
|
{
|
|
30
33
|
field: "flag",
|
|
@@ -32,64 +35,69 @@ var F = ({ height: i = "100dvh", onCategoryClick: s, onRowClick: c }) => {
|
|
|
32
35
|
minWidth: 32,
|
|
33
36
|
width: 32,
|
|
34
37
|
sortable: !1,
|
|
35
|
-
renderCell: (e) => /* @__PURE__ */
|
|
36
|
-
renderHeader: () => /* @__PURE__ */
|
|
38
|
+
renderCell: (e) => /* @__PURE__ */ o(R, { ...e }),
|
|
39
|
+
renderHeader: () => /* @__PURE__ */ o("span", { "aria-label": r.transaction_status })
|
|
37
40
|
},
|
|
38
41
|
{
|
|
39
42
|
field: "date",
|
|
40
|
-
|
|
43
|
+
getSortComparator: i,
|
|
44
|
+
headerName: r.date_title,
|
|
41
45
|
width: 103,
|
|
42
|
-
renderHeader:
|
|
43
|
-
renderCell: (e) => e.row.parent_guid ? null : /* @__PURE__ */
|
|
46
|
+
renderHeader: n,
|
|
47
|
+
renderCell: (e) => e.row.parent_guid ? null : /* @__PURE__ */ o(k, { ...e }),
|
|
44
48
|
sortingOrder: ["desc", "asc"]
|
|
45
49
|
},
|
|
46
50
|
{
|
|
47
51
|
cellClassName: "vertical-align-center",
|
|
48
52
|
field: "payee",
|
|
49
|
-
|
|
53
|
+
getSortComparator: i,
|
|
54
|
+
headerName: r.payee_title,
|
|
50
55
|
flex: 0.33,
|
|
51
|
-
renderHeader:
|
|
52
|
-
renderCell: (e) => /* @__PURE__ */
|
|
56
|
+
renderHeader: n,
|
|
57
|
+
renderCell: (e) => /* @__PURE__ */ o(D, {
|
|
53
58
|
...e,
|
|
54
|
-
excludedText:
|
|
59
|
+
excludedText: r.is_excluded
|
|
55
60
|
}),
|
|
56
61
|
sortingOrder: ["asc", "desc"]
|
|
57
62
|
},
|
|
58
63
|
{
|
|
59
64
|
field: "category",
|
|
60
|
-
|
|
65
|
+
getSortComparator: i,
|
|
66
|
+
headerName: r.category_title,
|
|
61
67
|
flex: 0.25,
|
|
62
|
-
renderHeader:
|
|
63
|
-
renderCell: (e) => /* @__PURE__ */
|
|
68
|
+
renderHeader: n,
|
|
69
|
+
renderCell: (e) => /* @__PURE__ */ o(P, { ...e }),
|
|
64
70
|
sortingOrder: ["asc", "desc"]
|
|
65
71
|
},
|
|
66
72
|
{
|
|
67
73
|
field: "account",
|
|
68
|
-
|
|
74
|
+
getSortComparator: i,
|
|
75
|
+
headerName: r.account_title,
|
|
69
76
|
flex: 0.33,
|
|
70
|
-
renderHeader:
|
|
71
|
-
renderCell: (e) => e.row.parent_guid ? null : /* @__PURE__ */
|
|
77
|
+
renderHeader: n,
|
|
78
|
+
renderCell: (e) => e.row.parent_guid ? null : /* @__PURE__ */ o(O, { ...e }),
|
|
72
79
|
sortingOrder: ["asc", "desc"]
|
|
73
80
|
},
|
|
74
81
|
{
|
|
75
82
|
field: "amount",
|
|
76
|
-
|
|
83
|
+
getSortComparator: i,
|
|
84
|
+
headerName: r.amount_title,
|
|
77
85
|
flex: 0.25,
|
|
78
|
-
renderHeader:
|
|
79
|
-
renderCell:
|
|
86
|
+
renderHeader: n,
|
|
87
|
+
renderCell: L,
|
|
80
88
|
align: "right",
|
|
81
89
|
headerAlign: "right",
|
|
82
90
|
sortingOrder: ["asc", "desc"]
|
|
83
91
|
}
|
|
84
92
|
];
|
|
85
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ o(G, {
|
|
86
94
|
sx: {
|
|
87
|
-
height:
|
|
95
|
+
height: a,
|
|
88
96
|
px: 24,
|
|
89
97
|
width: "100%",
|
|
90
98
|
boxShadow: "none"
|
|
91
99
|
},
|
|
92
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ o(I, {
|
|
93
101
|
columns: x,
|
|
94
102
|
disableColumnFilter: !0,
|
|
95
103
|
disableColumnMenu: !0,
|
|
@@ -99,10 +107,10 @@ var F = ({ height: i = "100dvh", onCategoryClick: s, onRowClick: c }) => {
|
|
|
99
107
|
field: "date",
|
|
100
108
|
sort: "desc"
|
|
101
109
|
}] } },
|
|
102
|
-
loading:
|
|
103
|
-
onCellClick:
|
|
104
|
-
onCellKeyDown:
|
|
105
|
-
rows:
|
|
110
|
+
loading: C,
|
|
111
|
+
onCellClick: u,
|
|
112
|
+
onCellKeyDown: w,
|
|
113
|
+
rows: _,
|
|
106
114
|
slotProps: { baseIconButton: { material: {
|
|
107
115
|
color: "secondary",
|
|
108
116
|
sx: { ml: 8 }
|
|
@@ -116,9 +124,9 @@ var F = ({ height: i = "100dvh", onCategoryClick: s, onRowClick: c }) => {
|
|
|
116
124
|
}
|
|
117
125
|
})
|
|
118
126
|
});
|
|
119
|
-
},
|
|
127
|
+
}, te = F(K);
|
|
120
128
|
export {
|
|
121
|
-
|
|
129
|
+
te as default
|
|
122
130
|
};
|
|
123
131
|
|
|
124
132
|
//# sourceMappingURL=TransactionTable.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionTable.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionTable.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Paper from '@mui/material/Paper'\nimport {
|
|
1
|
+
{"version":3,"file":"TransactionTable.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionTable.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Paper from '@mui/material/Paper'\nimport {\n DataGridPro,\n GridCellParams,\n GridColDef,\n GridSortCellParams,\n GridSortDirection,\n gridStringOrNumberComparator,\n} from '@mui/x-data-grid-pro'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n} from '../../../common'\n\nimport { useTransactionsUiStore } from '../../context/hooks'\n\nimport {\n AccountCell,\n AmountCell,\n CategoryCell,\n DateCell,\n FlagCell,\n HeaderCell,\n PayeeCell,\n} from './transactiontable/cells'\n\nconst isPendingRow = ({ api, id }: GridSortCellParams) => Boolean(api.getRow(id)?.isPending)\n\n// The grid reverses a plain sortComparator for desc, which would drop pending rows to the bottom.\nconst pendingFirst = (sortDirection: GridSortDirection) => {\n const direction = sortDirection === 'desc' ? -1 : 1\n\n return (v1: unknown, v2: unknown, p1: GridSortCellParams, p2: GridSortCellParams) =>\n Number(isPendingRow(p2)) - Number(isPendingRow(p1)) ||\n direction * gridStringOrNumberComparator(v1, v2, p1, p2)\n}\n\ninterface TransactionTableProps {\n height?: number | string\n onCategoryClick?: (guid: string) => void\n onRowClick?: (guid: string) => void\n}\n\nconst TransactionTable: React.FC<TransactionTableProps> = ({\n height = '100dvh',\n onCategoryClick,\n onRowClick,\n}) => {\n const { onEvent } = useEvent()\n const { transactions: copy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { isLoading, sortedTransactions } = useTransactionStore()\n const { clearExpandedSplits, toggleSplit } = useTransactionsUiStore()\n\n React.useEffect(() => {\n return () => clearExpandedSplits()\n }, [])\n\n const rows = React.useMemo(\n () =>\n sortedTransactions.map((transaction) => ({\n id: transaction.guid,\n isHovering: false,\n ...transaction,\n })),\n [sortedTransactions],\n )\n\n const handleCellClick = ({ row: { id, guid, has_been_split }, field }: GridCellParams) => {\n if (has_been_split) return toggleSplit(id)\n\n if (field === 'category') {\n onEvent(ANALYTICS_EVENTS.TRANSACTIONS_TABLE_CLICK_CATEGORY, { guid })\n return onCategoryClick?.(guid)\n }\n\n return onRowClick?.(guid)\n }\n\n const handleCellKeyDown = (params: GridCellParams, event: React.KeyboardEvent) => {\n if (event.key !== 'Enter' && event.key !== ' ') return\n handleCellClick(params)\n }\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const columns: GridColDef[] = [\n {\n field: 'flag',\n headerName: '',\n minWidth: 32,\n width: 32,\n sortable: false,\n renderCell: (params) => <FlagCell {...params} />,\n renderHeader: () => <span aria-label={copy.transaction_status} />,\n },\n {\n field: 'date',\n getSortComparator: pendingFirst,\n headerName: copy.date_title,\n width: 103,\n renderHeader: HeaderCell,\n renderCell: (params) => (params.row.parent_guid ? null : <DateCell {...params} />),\n sortingOrder: ['desc', 'asc'],\n },\n {\n cellClassName: 'vertical-align-center',\n field: 'payee',\n getSortComparator: pendingFirst,\n headerName: copy.payee_title,\n flex: 0.33,\n renderHeader: HeaderCell,\n renderCell: (params) => <PayeeCell {...params} excludedText={copy.is_excluded} />,\n sortingOrder: ['asc', 'desc'],\n },\n {\n field: 'category',\n getSortComparator: pendingFirst,\n headerName: copy.category_title,\n flex: 0.25,\n renderHeader: HeaderCell,\n renderCell: (params) => <CategoryCell {...params} />,\n sortingOrder: ['asc', 'desc'],\n },\n {\n field: 'account',\n getSortComparator: pendingFirst,\n headerName: copy.account_title,\n flex: 0.33,\n renderHeader: HeaderCell,\n renderCell: (params) => (params.row.parent_guid ? null : <AccountCell {...params} />),\n sortingOrder: ['asc', 'desc'],\n },\n {\n field: 'amount',\n getSortComparator: pendingFirst,\n headerName: copy.amount_title,\n flex: 0.25,\n renderHeader: HeaderCell,\n renderCell: AmountCell,\n align: 'right',\n headerAlign: 'right',\n sortingOrder: ['asc', 'desc'],\n },\n ]\n\n return (\n <Paper sx={{ height: height, px: 24, width: '100%', boxShadow: 'none' }}>\n <DataGridPro\n columns={columns}\n disableColumnFilter={true}\n disableColumnMenu={true}\n getCellClassName={(params) => {\n if (params.row.parent_guid) return 'split-row'\n if (params.row.is_hidden) return 'excluded-row'\n return ''\n }}\n hideFooter={true}\n initialState={{ sorting: { sortModel: [{ field: 'date', sort: 'desc' }] } }}\n loading={isLoading}\n onCellClick={handleCellClick}\n onCellKeyDown={handleCellKeyDown}\n rows={rows}\n slotProps={{ baseIconButton: { material: { color: 'secondary', sx: { ml: 8 } } } }}\n sx={{\n '& .split-row': {\n bgcolor: 'background.default',\n },\n '& .excluded-row': {\n bgcolor: 'grey.50',\n color: 'text.secondary',\n },\n }}\n />\n </Paper>\n )\n}\n\nexport default observer(TransactionTable)\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,IAAM,IAAA,CAAgB,EAAE,KAAA,GAAK,IAAA,EAAA,MAA6B,EAAQ,EAAI,OAAO,CAAE,GAAG,WAG5E,IAAA,CAAgB,MAAqC;AACzD,QAAM,IAAY,MAAkB,SAAS,KAAK;AAElD,SAAA,CAAQ,GAAa,GAAa,GAAwB,MACxD,OAAO,EAAa,CAAE,CAAC,IAAI,OAAO,EAAa,CAAE,CAAC,KAClD,IAAY,EAA6B,GAAI,GAAI,GAAI,CAAE;AAC3D,GAQM,IAAA,CAAqD,EACzD,QAAA,IAAS,UACT,iBAAA,GACA,YAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,cAAc,EAAA,IAAS,EAAmB,GAC5C,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,WAAA,GAAW,oBAAA,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ACb,EAAO,IAAI,cAAoB,cAC/B,EAAO,IAAI,YAAkB,iBAC1B;AAAA,MAET,YAAY;AAAA,MACZ,cAAc,EAAE,SAAS,EAAE,WAAW,CAAC;AAAA,QAAE,OAAO;AAAA,QAAQ,MAAM;AAAA,MAAO,CAAC,EAAE,EAAE;AAAA,MAC1E,SAAS;AAAA,MACT,aAAa;AAAA,MACb,eAAe;AAAA,MACT,MAAA;AAAA,MACN,WAAW,EAAE,gBAAgB,EAAE,UAAU;AAAA,QAAE,OAAO;AAAA,QAAa,IAAI,EAAE,IAAI,EAAE;AAAA,MAAE,EAAE,EAAE;AAAA,MACjF,IAAI;AAAA,QACF,gBAAgB,EACd,SAAS,qBACX;AAAA,QACA,mBAAmB;AAAA,UACjB,SAAS;AAAA,UACT,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACD,CAAA;AAAA,EACI,CAAA;AAEX,GAEA,KAAe,EAAS,CAAgB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { GridCellParams } from '@mui/x-data-grid';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
2
|
+
declare const _default: ((params: GridCellParams) => import("react/jsx-runtime").JSX.Element) & {
|
|
3
|
+
displayName: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as t, formatDate as
|
|
2
|
-
import {
|
|
1
|
+
import { DATE_FORMATS_INTL as t, formatDate as e } from "../../../../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { useGlobalCopyStore as m } from "../../../../../common/context/hooks.es.js";
|
|
3
|
+
import { fromUnixUTC as n } from "../../../../../core/utils/DateUtil.es.js";
|
|
4
|
+
import { observer as i } from "mobx-react-lite";
|
|
3
5
|
import { Text as a } from "@mxenabled/mxui";
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
7
|
+
var d = (o) => {
|
|
8
|
+
const { common: r } = m();
|
|
9
|
+
return /* @__PURE__ */ f(a, {
|
|
10
|
+
tabIndex: o.tabIndex,
|
|
11
|
+
variant: "body2",
|
|
12
|
+
children: o.row.isPending ? r.pending : e(n(o.row.date), t.MONTH_DAY)
|
|
13
|
+
});
|
|
14
|
+
}, D = i(d);
|
|
10
15
|
export {
|
|
11
|
-
|
|
16
|
+
D as default
|
|
12
17
|
};
|
|
13
18
|
|
|
14
19
|
//# sourceMappingURL=DateCell.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateCell.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiontable/cells/DateCell.tsx"],"sourcesContent":["import { GridCellParams } from '@mui/x-data-grid'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../../core/constants'\nimport { fromUnixUTC } from '../../../../../core/utils/DateUtil'\n\nconst DateCell = (params: GridCellParams) => {\n return (\n <Text tabIndex={params.tabIndex} variant=\"body2\">\n {formatDate(fromUnixUTC(params.row.date), DATE_FORMATS_INTL.MONTH_DAY)}\n </Text>\n )\n}\n\nexport default DateCell\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateCell.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiontable/cells/DateCell.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport { GridCellParams } from '@mui/x-data-grid'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore } from '../../../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../../core/constants'\nimport { fromUnixUTC } from '../../../../../core/utils/DateUtil'\n\nconst DateCell = (params: GridCellParams) => {\n const { common: commonCopy } = useGlobalCopyStore()\n\n return (\n <Text tabIndex={params.tabIndex} variant=\"body2\">\n {params.row.isPending\n ? commonCopy.pending\n : formatDate(fromUnixUTC(params.row.date), DATE_FORMATS_INTL.MONTH_DAY)}\n </Text>\n )\n}\n\nexport default observer(DateCell)\n"],"mappings":";;;;;;AASA,IAAM,IAAA,CAAY,MAA2B;AAC3C,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB;AAElD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAM,UAAU,EAAO;AAAA,IAAU,SAAQ;AAAA,IACtC,UAAA,EAAO,IAAI,YACR,EAAW,UACX,EAAW,EAAY,EAAO,IAAI,IAAI,GAAG,EAAkB,SAAS;AAAA,EACpE,CAAA;AAEV,GAEA,IAAe,EAAS,CAAQ"}
|
|
@@ -7,7 +7,7 @@ export interface ChartDataProps {
|
|
|
7
7
|
date: string;
|
|
8
8
|
}
|
|
9
9
|
export declare const sortByDate: (a: Transaction, b: Transaction) => number;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const shouldShowSubheader: (index: number, transactions: Transaction[]) => boolean;
|
|
11
11
|
export declare const hasInsetBorder: (index: number, transactions: Transaction[]) => boolean;
|
|
12
12
|
export declare const buildDataSeries: (data?: DataSeries) => {
|
|
13
13
|
[k: string]: any;
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as
|
|
2
|
-
import { fromUnixUTC as
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { isSameDay as
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
const t = m(e[r].date), a = m(e[r - 1].date);
|
|
8
|
-
return !o(t, a);
|
|
9
|
-
}, d = (r, e) => {
|
|
10
|
-
if (r === e.length - 1) return !1;
|
|
11
|
-
const t = m(e[r].date), a = m(e[r + 1].date);
|
|
12
|
-
return o(t, a);
|
|
13
|
-
}, l = (r) => r?.data ? r.data.map((e) => Object.fromEntries((r.names || []).map((t, a) => [t, e[a]]))) : [], v = (r, e = "") => r.map((t) => {
|
|
14
|
-
const a = f(t.date, n.MONTH_SHORT);
|
|
1
|
+
import { DATE_FORMATS_INTL as u, formatDate as i } from "../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { fromUnixUTC as o } from "../../core/utils/DateUtil.es.js";
|
|
3
|
+
import { formatCurrency as t } from "../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { isSameDay as f } from "date-fns/isSameDay";
|
|
5
|
+
var n = (r, e) => r.isPending || e.isPending ? !!r.isPending == !!e.isPending : f(o(r.date), o(e.date)), l = (r, e) => r === 0 || !n(e[r], e[r - 1]), s = (r, e) => r < e.length - 1 && n(e[r], e[r + 1]), v = (r) => r?.data ? r.data.map((e) => Object.fromEntries((r.names || []).map((a, m) => [a, e[m]]))) : [], T = (r, e = "") => r.map((a) => {
|
|
6
|
+
const m = i(a.date, u.MONTH_SHORT);
|
|
15
7
|
return {
|
|
16
8
|
ariaLabel: `
|
|
17
|
-
${
|
|
18
|
-
${
|
|
9
|
+
${m},
|
|
10
|
+
${t(a.amount, "0.00")},
|
|
19
11
|
${e}`,
|
|
20
|
-
label:
|
|
21
|
-
value:
|
|
22
|
-
formattedAmount:
|
|
12
|
+
label: m,
|
|
13
|
+
value: a.amount,
|
|
14
|
+
formattedAmount: t(a.amount, "0,0")
|
|
23
15
|
};
|
|
24
16
|
});
|
|
25
17
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
T as buildChartData,
|
|
19
|
+
v as buildDataSeries,
|
|
20
|
+
s as hasInsetBorder,
|
|
21
|
+
l as shouldShowSubheader
|
|
30
22
|
};
|
|
31
23
|
|
|
32
24
|
//# sourceMappingURL=Transactions.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.es.js","names":[],"sources":["../../../src/transactions/utils/Transactions.ts"],"sourcesContent":["import { isSameDay } from 'date-fns/isSameDay'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../core/constants'\nimport { fromUnixUTC } from '../../core/utils/DateUtil'\nimport { type DataSeries, type Transaction } from '../../core'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\nexport interface ChartDataProps {\n guid?: string\n label?: string\n localized_label?: string\n amount: number\n date: string\n}\n\nexport const sortByDate = (a: Transaction, b: Transaction) => {\n return b.date - a.date\n}\n\
|
|
1
|
+
{"version":3,"file":"Transactions.es.js","names":[],"sources":["../../../src/transactions/utils/Transactions.ts"],"sourcesContent":["import { isSameDay } from 'date-fns/isSameDay'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../core/constants'\nimport { fromUnixUTC } from '../../core/utils/DateUtil'\nimport { type DataSeries, type Transaction } from '../../core'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\nexport interface ChartDataProps {\n guid?: string\n label?: string\n localized_label?: string\n amount: number\n date: string\n}\n\nexport const sortByDate = (a: Transaction, b: Transaction) => {\n return b.date - a.date\n}\n\nconst isSameSubheader = (a: Transaction, b: Transaction) => {\n if (a.isPending || b.isPending) return Boolean(a.isPending) === Boolean(b.isPending)\n\n return isSameDay(fromUnixUTC(a.date), fromUnixUTC(b.date))\n}\n\nexport const shouldShowSubheader = (index: number, transactions: Transaction[]) =>\n index === 0 || !isSameSubheader(transactions[index], transactions[index - 1])\n\nexport const hasInsetBorder = (index: number, transactions: Transaction[]) =>\n index < transactions.length - 1 && isSameSubheader(transactions[index], transactions[index + 1])\n\nexport const buildDataSeries = (data?: DataSeries) => {\n if (!data?.data) return []\n\n return data.data.map((row) => {\n return Object.fromEntries((data.names || []).map((name, index) => [name, row[index]]))\n })\n}\n\nexport const buildChartData = (dataSeries: ChartDataProps[], merchantName = '') => {\n const data = dataSeries.map((total) => {\n const label = formatDate(total.date, DATE_FORMATS_INTL.MONTH_SHORT)\n\n return {\n ariaLabel: `\n ${label},\n ${formatCurrency(total.amount, '0.00')},\n ${merchantName}`,\n label,\n value: total.amount,\n formattedAmount: formatCurrency(total.amount, '0,0'),\n }\n })\n\n return data\n}\n"],"mappings":";;;;AAmBA,IAAM,IAAA,CAAmB,GAAgB,MACnC,EAAE,aAAa,EAAE,YAAkB,EAAQ,EAAE,aAAe,EAAQ,EAAE,YAEnE,EAAU,EAAY,EAAE,IAAI,GAAG,EAAY,EAAE,IAAI,CAAC,GAG9C,IAAA,CAAuB,GAAe,MACjD,MAAU,KAAK,CAAC,EAAgB,EAAa,CAAA,GAAQ,EAAa,IAAQ,CAAA,CAAE,GAEjE,IAAA,CAAkB,GAAe,MAC5C,IAAQ,EAAa,SAAS,KAAK,EAAgB,EAAa,CAAA,GAAQ,EAAa,IAAQ,CAAA,CAAE,GAEpF,IAAA,CAAmB,MACzB,GAAM,OAEJ,EAAK,KAAK,IAAA,CAAK,MACb,OAAO,aAAa,EAAK,SAAS,CAAC,GAAG,IAAA,CAAK,GAAM,MAAU,CAAC,GAAM,EAAI,CAAA,CAAM,CAAC,CAAC,CACtF,IAJuB,CAAC,GAOd,IAAA,CAAkB,GAA8B,IAAe,OAC7D,EAAW,IAAA,CAAK,MAAU;AACrC,QAAM,IAAQ,EAAW,EAAM,MAAM,EAAkB,WAAW;AAElE,SAAO;AAAA,IACL,WAAW;AAAA,UACP,CAAA;AAAA,UACA,EAAe,EAAM,QAAQ,MAAM,CAAA;AAAA,UACnC,CAAA;AAAA,IACJ,OAAA;AAAA,IACA,OAAO,EAAM;AAAA,IACb,iBAAiB,EAAe,EAAM,QAAQ,KAAK;AAAA,EACrD;AACF,CAEO"}
|