@mx-cartographer/experiences 9.7.186 → 9.7.187
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 +5 -1
- package/dist/common/components/charts/linechart/CustomMark.es.js +26 -29
- package/dist/common/components/charts/linechart/CustomMark.es.js.map +1 -1
- package/dist/common/utils/MouseOnly.d.ts +2 -0
- package/dist/common/utils/MouseOnly.es.js +8 -0
- package/dist/common/utils/MouseOnly.es.js.map +1 -0
- package/dist/networth/components/NetWorthListItem.es.js +25 -24
- package/dist/networth/components/NetWorthListItem.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
## [9.7.187] - 11-18-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Month selection in the net worth widget on touch devices (WELL-50)
|
|
4
|
+
|
|
1
5
|
## [9.7.186] - 11-18-2026
|
|
2
6
|
|
|
3
7
|
- **FIXED** - Monthly Deposit Summary's donut and legend stay centred in a wider card (WEC-2341)
|
|
4
8
|
- **FIXED** - Monthly Deposit Summary's drawer legend reads "Deposit", with no amount (WEC-2341)
|
|
5
9
|
- **FIXED** - Spend, Savings, Debt and Cost of Living to Income drawers draw their legend at one size (13px), and Savings to Income's tip has no close button (WEC-2341)
|
|
6
|
-
- **FIXED** - Bar charts follow their card's width when the
|
|
10
|
+
- **FIXED** - Bar charts follow their card's width when the card resizes, so Savings Account Balance Summary no longer clips its last bars (WEC-2341)
|
|
7
11
|
|
|
8
12
|
## [9.7.185] - 11-18-2026
|
|
9
13
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { formatCurrency as F } from "../../../../core/utils/NumberFormatting.es.js";
|
|
2
2
|
import { MARKER_SHAPE_PATHS as T } from "./utils/markerShapes.es.js";
|
|
3
|
+
import { mouseOnly as M } from "../../../utils/MouseOnly.es.js";
|
|
3
4
|
import x from "react";
|
|
4
|
-
import { Fragment as
|
|
5
|
+
import { Fragment as S, jsx as h, jsxs as A } from "react/jsx-runtime";
|
|
5
6
|
import { useTheme as B } from "@mui/material/styles";
|
|
6
7
|
import I from "@mui/material/useMediaQuery";
|
|
7
|
-
var
|
|
8
|
-
const a = B(), o = t.showLabel, e = t.style,
|
|
8
|
+
var R = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, z = 12, y = 16, j = (t) => {
|
|
9
|
+
const a = B(), o = t.showLabel, e = t.style, L = e?.markLabelStyles, l = Number(t.x), d = Number(t.y), r = t.variant === "compact", u = t.handlers?.onMarkClick, v = t.handlers?.onMouseEnter, P = t.handlers?.onMouseLeave, _ = I(a.breakpoints.up("sm")), f = x.useRef(null), [w, E] = x.useState(0), b = t.valueFormatterString ? F(t.yData[t.dataIndex], t.valueFormatterString) : String(t.yData[t.dataIndex]), g = _ ? a.typography.body2?.fontSize : a.typography.caption?.fontSize;
|
|
9
10
|
x.useLayoutEffect(() => {
|
|
10
11
|
r && o && E(f.current?.getBBox?.().width ?? 0);
|
|
11
12
|
}, [
|
|
12
13
|
r,
|
|
13
14
|
o,
|
|
14
15
|
b,
|
|
15
|
-
|
|
16
|
+
g,
|
|
16
17
|
t.labelFontSize
|
|
17
18
|
]);
|
|
18
19
|
let n = {
|
|
@@ -21,28 +22,28 @@ var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
|
|
|
21
22
|
width: 30,
|
|
22
23
|
x: l - 15,
|
|
23
24
|
y: d - 30
|
|
24
|
-
},
|
|
25
|
+
}, m = {
|
|
25
26
|
x: l,
|
|
26
27
|
y: d - 16
|
|
27
28
|
};
|
|
28
29
|
if (r) {
|
|
29
|
-
const
|
|
30
|
+
const c = t.dataIndex === 0 ? "start" : t.dataIndex === t.yData.length - 1 ? "end" : "middle", i = w + 4, C = {
|
|
30
31
|
start: l - s,
|
|
31
32
|
middle: l - i / 2,
|
|
32
33
|
end: l + s - i
|
|
33
|
-
}[
|
|
34
|
+
}[c], k = d - s - z;
|
|
34
35
|
n = {
|
|
35
|
-
height:
|
|
36
|
+
height: y,
|
|
36
37
|
rx: 2,
|
|
37
38
|
width: i,
|
|
38
|
-
x:
|
|
39
|
-
y:
|
|
40
|
-
},
|
|
41
|
-
x:
|
|
42
|
-
y:
|
|
39
|
+
x: C,
|
|
40
|
+
y: k - y
|
|
41
|
+
}, m = {
|
|
42
|
+
x: C + i / 2,
|
|
43
|
+
y: k - y / 2
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
return /* @__PURE__ */ S
|
|
46
|
+
return /* @__PURE__ */ A(S, { children: [o && /* @__PURE__ */ A(S, { children: [t.labelBackgroundColor && /* @__PURE__ */ h("rect", {
|
|
46
47
|
fill: t.labelBackgroundColor,
|
|
47
48
|
height: n.height,
|
|
48
49
|
rx: n.rx,
|
|
@@ -55,26 +56,22 @@ var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
|
|
|
55
56
|
fill: t.labelFontColor ? t.labelFontColor : a.palette.text.primary,
|
|
56
57
|
ref: f,
|
|
57
58
|
style: {
|
|
58
|
-
fontSize: t.labelFontSize ? t.labelFontSize :
|
|
59
|
-
...
|
|
59
|
+
fontSize: t.labelFontSize ? t.labelFontSize : g,
|
|
60
|
+
...L
|
|
60
61
|
},
|
|
61
62
|
textAnchor: "middle",
|
|
62
|
-
x:
|
|
63
|
-
y:
|
|
63
|
+
x: m.x,
|
|
64
|
+
y: m.y,
|
|
64
65
|
children: b
|
|
65
66
|
})] }), t.showMark && /* @__PURE__ */ h("path", {
|
|
66
|
-
cursor:
|
|
67
|
-
d: r ?
|
|
67
|
+
cursor: u ? "pointer" : "unset",
|
|
68
|
+
d: r ? R : T[t.shape ?? "circle"],
|
|
68
69
|
height: "20px",
|
|
69
|
-
onClick: (
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
onMouseEnter: () => {
|
|
73
|
-
L?.(t.dataIndex);
|
|
74
|
-
},
|
|
75
|
-
onMouseLeave: () => {
|
|
76
|
-
v?.();
|
|
70
|
+
onClick: (c) => {
|
|
71
|
+
u?.(c, t.dataIndex);
|
|
77
72
|
},
|
|
73
|
+
onPointerEnter: M(() => v?.(t.dataIndex)),
|
|
74
|
+
onPointerLeave: M(() => P?.()),
|
|
78
75
|
style: {
|
|
79
76
|
fill: e?.fill ? e.fill : a.palette.background.paper,
|
|
80
77
|
stroke: e?.stroke ? e.stroke : a.palette.primary.main,
|
|
@@ -87,7 +84,7 @@ var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
|
|
|
87
84
|
})] });
|
|
88
85
|
};
|
|
89
86
|
export {
|
|
90
|
-
|
|
87
|
+
j as CustomMark
|
|
91
88
|
};
|
|
92
89
|
|
|
93
90
|
//# sourceMappingURL=CustomMark.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMark.es.js","names":[],"sources":["../../../../../src/common/components/charts/linechart/CustomMark.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\n\nimport type { MarkElementProps } from '@mui/x-charts'\n\nimport { MARKER_SHAPE_PATHS } from './utils/markerShapes'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nexport type MarkHandlers = {\n onMarkClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter?: (dataIndex: number) => void\n onMouseLeave?: () => void\n}\n\n// compact: a 10px mark, and a 16px label box that fits its text, 12px above the mark.\n// The first and last label alignment assumes a single series.\nexport type MarkVariant = 'default' | 'compact'\n\nconst COMPACT_MARK_PATH = 'M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0'\nconst COMPACT_MARK_RADIUS = 5\nconst COMPACT_LABEL_GAP = 12\nconst COMPACT_LABEL_HEIGHT = 16\nconst COMPACT_LABEL_PADDING = 2\n\ninterface CustomMarkProps extends MarkElementProps {\n handlers?: MarkHandlers\n showLabel: boolean\n showMark?: boolean\n variant?: MarkVariant\n yData: number[]\n style?: React.CSSProperties & {\n markLabelStyles?: React.CSSProperties\n }\n labelBackgroundColor?: string\n labelFontColor?: string\n labelFontSize?: number\n valueFormatterString?: string\n}\n\nexport const CustomMark: React.FC<CustomMarkProps> = (props) => {\n const theme = useTheme()\n const showLabel = props.showLabel\n const styles = props.style\n const markLabelStyles = styles?.markLabelStyles\n const xNumber = Number(props.x)\n const yNumber = Number(props.y)\n const isCompact = props.variant === 'compact'\n\n const handleMarkClick = props.handlers?.onMarkClick\n const handleMouseEnter = props.handlers?.onMouseEnter\n const handleMouseLeave = props.handlers?.onMouseLeave\n\n const isSmallScreenUp = useMediaQuery(theme.breakpoints.up('sm'))\n const textRef = React.useRef<SVGTextElement>(null)\n const [textWidth, setTextWidth] = React.useState(0)\n\n // Calculate text dimensions for proper background sizing\n const formattedValue = props.valueFormatterString\n ? formatCurrency(props.yData[props.dataIndex], props.valueFormatterString)\n : String(props.yData[props.dataIndex])\n const fontSize = isSmallScreenUp\n ? theme.typography.body2?.fontSize\n : theme.typography.caption?.fontSize\n\n React.useLayoutEffect(() => {\n if (isCompact && showLabel) setTextWidth(textRef.current?.getBBox?.().width ?? 0)\n }, [isCompact, showLabel, formattedValue, fontSize, props.labelFontSize])\n\n let rect = { height: 24, rx: 3, width: 30, x: xNumber - 15, y: yNumber - 30 }\n let text = { x: xNumber, y: yNumber - 16 }\n\n if (isCompact) {\n // The first and last labels line up with the outer edge of their mark, so they stay inside the plot.\n const align =\n props.dataIndex === 0\n ? 'start'\n : props.dataIndex === props.yData.length - 1\n ? 'end'\n : 'middle'\n const width = textWidth + COMPACT_LABEL_PADDING * 2\n const boxX = {\n start: xNumber - COMPACT_MARK_RADIUS,\n middle: xNumber - width / 2,\n end: xNumber + COMPACT_MARK_RADIUS - width,\n }[align]\n const boxBottom = yNumber - COMPACT_MARK_RADIUS - COMPACT_LABEL_GAP\n\n rect = {\n height: COMPACT_LABEL_HEIGHT,\n rx: 2,\n width,\n x: boxX,\n y: boxBottom - COMPACT_LABEL_HEIGHT,\n }\n text = { x: boxX + width / 2, y: boxBottom - COMPACT_LABEL_HEIGHT / 2 }\n }\n\n return (\n <>\n {showLabel && (\n <>\n {props.labelBackgroundColor && (\n <rect\n fill={props.labelBackgroundColor}\n height={rect.height}\n rx={rect.rx}\n width={rect.width}\n x={rect.x}\n y={rect.y}\n />\n )}\n\n <text\n className=\"MuiLineChart-markLabel\"\n dominantBaseline=\"middle\"\n fill={props.labelFontColor ? props.labelFontColor : theme.palette.text.primary}\n ref={textRef}\n style={{\n fontSize: props.labelFontSize ? props.labelFontSize : fontSize,\n ...markLabelStyles,\n }}\n textAnchor=\"middle\"\n x={text.x}\n y={text.y}\n >\n {formattedValue}\n </text>\n </>\n )}\n {props.showMark && (\n <path\n cursor={handleMarkClick ? 'pointer' : 'unset'}\n d={isCompact ? COMPACT_MARK_PATH : MARKER_SHAPE_PATHS[props.shape ?? 'circle']}\n height=\"20px\"\n onClick={(event) => {\n handleMarkClick?.(event, props.dataIndex)\n }}\n
|
|
1
|
+
{"version":3,"file":"CustomMark.es.js","names":[],"sources":["../../../../../src/common/components/charts/linechart/CustomMark.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\n\nimport type { MarkElementProps } from '@mui/x-charts'\n\nimport { MARKER_SHAPE_PATHS } from './utils/markerShapes'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { mouseOnly } from '../../../utils/MouseOnly'\n\nexport type MarkHandlers = {\n onMarkClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter?: (dataIndex: number) => void\n onMouseLeave?: () => void\n}\n\n// compact: a 10px mark, and a 16px label box that fits its text, 12px above the mark.\n// The first and last label alignment assumes a single series.\nexport type MarkVariant = 'default' | 'compact'\n\nconst COMPACT_MARK_PATH = 'M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0'\nconst COMPACT_MARK_RADIUS = 5\nconst COMPACT_LABEL_GAP = 12\nconst COMPACT_LABEL_HEIGHT = 16\nconst COMPACT_LABEL_PADDING = 2\n\ninterface CustomMarkProps extends MarkElementProps {\n handlers?: MarkHandlers\n showLabel: boolean\n showMark?: boolean\n variant?: MarkVariant\n yData: number[]\n style?: React.CSSProperties & {\n markLabelStyles?: React.CSSProperties\n }\n labelBackgroundColor?: string\n labelFontColor?: string\n labelFontSize?: number\n valueFormatterString?: string\n}\n\nexport const CustomMark: React.FC<CustomMarkProps> = (props) => {\n const theme = useTheme()\n const showLabel = props.showLabel\n const styles = props.style\n const markLabelStyles = styles?.markLabelStyles\n const xNumber = Number(props.x)\n const yNumber = Number(props.y)\n const isCompact = props.variant === 'compact'\n\n const handleMarkClick = props.handlers?.onMarkClick\n const handleMouseEnter = props.handlers?.onMouseEnter\n const handleMouseLeave = props.handlers?.onMouseLeave\n\n const isSmallScreenUp = useMediaQuery(theme.breakpoints.up('sm'))\n const textRef = React.useRef<SVGTextElement>(null)\n const [textWidth, setTextWidth] = React.useState(0)\n\n // Calculate text dimensions for proper background sizing\n const formattedValue = props.valueFormatterString\n ? formatCurrency(props.yData[props.dataIndex], props.valueFormatterString)\n : String(props.yData[props.dataIndex])\n const fontSize = isSmallScreenUp\n ? theme.typography.body2?.fontSize\n : theme.typography.caption?.fontSize\n\n React.useLayoutEffect(() => {\n if (isCompact && showLabel) setTextWidth(textRef.current?.getBBox?.().width ?? 0)\n }, [isCompact, showLabel, formattedValue, fontSize, props.labelFontSize])\n\n let rect = { height: 24, rx: 3, width: 30, x: xNumber - 15, y: yNumber - 30 }\n let text = { x: xNumber, y: yNumber - 16 }\n\n if (isCompact) {\n // The first and last labels line up with the outer edge of their mark, so they stay inside the plot.\n const align =\n props.dataIndex === 0\n ? 'start'\n : props.dataIndex === props.yData.length - 1\n ? 'end'\n : 'middle'\n const width = textWidth + COMPACT_LABEL_PADDING * 2\n const boxX = {\n start: xNumber - COMPACT_MARK_RADIUS,\n middle: xNumber - width / 2,\n end: xNumber + COMPACT_MARK_RADIUS - width,\n }[align]\n const boxBottom = yNumber - COMPACT_MARK_RADIUS - COMPACT_LABEL_GAP\n\n rect = {\n height: COMPACT_LABEL_HEIGHT,\n rx: 2,\n width,\n x: boxX,\n y: boxBottom - COMPACT_LABEL_HEIGHT,\n }\n text = { x: boxX + width / 2, y: boxBottom - COMPACT_LABEL_HEIGHT / 2 }\n }\n\n return (\n <>\n {showLabel && (\n <>\n {props.labelBackgroundColor && (\n <rect\n fill={props.labelBackgroundColor}\n height={rect.height}\n rx={rect.rx}\n width={rect.width}\n x={rect.x}\n y={rect.y}\n />\n )}\n\n <text\n className=\"MuiLineChart-markLabel\"\n dominantBaseline=\"middle\"\n fill={props.labelFontColor ? props.labelFontColor : theme.palette.text.primary}\n ref={textRef}\n style={{\n fontSize: props.labelFontSize ? props.labelFontSize : fontSize,\n ...markLabelStyles,\n }}\n textAnchor=\"middle\"\n x={text.x}\n y={text.y}\n >\n {formattedValue}\n </text>\n </>\n )}\n {props.showMark && (\n <path\n cursor={handleMarkClick ? 'pointer' : 'unset'}\n d={isCompact ? COMPACT_MARK_PATH : MARKER_SHAPE_PATHS[props.shape ?? 'circle']}\n height=\"20px\"\n onClick={(event) => {\n handleMarkClick?.(event, props.dataIndex)\n }}\n onPointerEnter={mouseOnly(() => handleMouseEnter?.(props.dataIndex))}\n onPointerLeave={mouseOnly(() => handleMouseLeave?.())}\n style={{\n fill: styles?.fill ? styles.fill : theme.palette.background.paper,\n stroke: styles?.stroke ? styles.stroke : theme.palette.primary.main,\n strokeWidth: 2,\n transform: `translate(${props.x}px, ${props.y}px)`,\n transformOrigin: `${props.x}px, ${props.y}px`,\n filter: styles?.filter ? styles.filter : 'none',\n }}\n width=\"20px\"\n />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;AA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,EAAA,MAAgB,IAAmB,CAAC;AAAA,IACpD,OAAO;AAAA,MACL,MAAM,GAAQ,OAAO,EAAO,OAAO,EAAM,QAAQ,WAAW;AAAA,MAC5D,QAAQ,GAAQ,SAAS,EAAO,SAAS,EAAM,QAAQ,QAAQ;AAAA,MAC/D,aAAa;AAAA,MACb,WAAW,aAAa,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MAC5C,iBAAiB,GAAG,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MACxC,QAAQ,GAAQ,SAAS,EAAO,SAAS;AAAA,IAC3C;AAAA,IACA,OAAM;AAAA,EACP,CAAA,CAEH,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MouseOnly.es.js","names":[],"sources":["../../../src/common/utils/MouseOnly.ts"],"sourcesContent":["import type React from 'react'\n\n// On iOS, a hover handler that changes the screen cancels the tap's click, so a tapped item\n// would show as hovered but never become selected. Touch and pen (Apple Pencil hits the same\n// problem) skip hover and go straight to click.\nexport const mouseOnly =\n (handler: () => void) =>\n (event: React.PointerEvent): void => {\n if (event.pointerType === 'mouse') handler()\n }\n"],"mappings":"AAKA,IAAa,IAAA,CACV,MAAA,CACA,MAAoC;AACnC,EAAI,EAAM,gBAAgB,WAAS,EAAQ;AAC7C"}
|
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { fromTimestampToMonthYear as
|
|
2
|
-
import { CurrencyText as
|
|
1
|
+
import { fromTimestampToMonthYear as a } from "../../core/utils/DateUtil.es.js";
|
|
2
|
+
import { CurrencyText as u } from "../../common/components/CurrencyText.es.js";
|
|
3
|
+
import { mouseOnly as m } from "../../common/utils/MouseOnly.es.js";
|
|
3
4
|
import e from "react";
|
|
4
|
-
import { observer as
|
|
5
|
+
import { observer as y } from "mobx-react-lite";
|
|
5
6
|
import v from "@mui/material/Stack";
|
|
6
|
-
import { Text as
|
|
7
|
-
import { jsx as t, jsxs as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
var
|
|
13
|
-
const [i,
|
|
7
|
+
import { Text as d } from "@mxenabled/mxui";
|
|
8
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
import I from "@mui/material/Divider";
|
|
10
|
+
import L from "@mui/material/ListItem";
|
|
11
|
+
import g from "@mui/material/ListItemButton";
|
|
12
|
+
import T from "@mui/material/ListItemText";
|
|
13
|
+
var b = ({ item: r, getStyles: n, isHovered: f = !1, isSelected: o = !1, onItemClick: l, onMouseEnter: p, onMouseLeave: c }) => {
|
|
14
|
+
const [i, h] = e.useState({ color: "" });
|
|
14
15
|
return e.useEffect(() => {
|
|
15
|
-
|
|
16
|
-
}, [
|
|
16
|
+
h(n(r));
|
|
17
|
+
}, [f, o]), /* @__PURE__ */ s(e.Fragment, { children: [/* @__PURE__ */ t(L, {
|
|
17
18
|
sx: {
|
|
18
19
|
...i,
|
|
19
20
|
minHeight: 44,
|
|
20
21
|
"&:hover": { color: o ? "inherit" : i.color }
|
|
21
22
|
},
|
|
22
|
-
children: /* @__PURE__ */ t(
|
|
23
|
-
onClick: (
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
children: /* @__PURE__ */ t(g, {
|
|
24
|
+
onClick: (x) => l?.(x, r.x),
|
|
25
|
+
onPointerEnter: m(() => p(r.x)),
|
|
26
|
+
onPointerLeave: m(c),
|
|
26
27
|
sx: {
|
|
27
28
|
minHeight: 20,
|
|
28
29
|
padding: 12
|
|
29
30
|
},
|
|
30
|
-
children: /* @__PURE__ */ t(
|
|
31
|
+
children: /* @__PURE__ */ t(T, { primary: /* @__PURE__ */ s(v, {
|
|
31
32
|
direction: "row",
|
|
32
33
|
justifyContent: "space-between",
|
|
33
34
|
sx: { fontWeight: 400 },
|
|
34
|
-
children: [/* @__PURE__ */ t(
|
|
35
|
+
children: [/* @__PURE__ */ t(d, {
|
|
35
36
|
variant: "body1",
|
|
36
|
-
children:
|
|
37
|
-
}), /* @__PURE__ */ t(
|
|
37
|
+
children: a(r.x)
|
|
38
|
+
}), /* @__PURE__ */ t(u, {
|
|
38
39
|
amount: r.y,
|
|
39
40
|
sx: { color: "inherit" },
|
|
40
41
|
variant: "body1"
|
|
41
42
|
})]
|
|
42
43
|
}) })
|
|
43
44
|
})
|
|
44
|
-
}), /* @__PURE__ */ t(
|
|
45
|
-
},
|
|
45
|
+
}), /* @__PURE__ */ t(I, {})] }, r.x);
|
|
46
|
+
}, M = y(b);
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
M as default
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
//# sourceMappingURL=NetWorthListItem.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetWorthListItem.es.js","names":[],"sources":["../../../src/networth/components/NetWorthListItem.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Divider from '@mui/material/Divider'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { CurrencyText } from '../../common/'\n\nimport { fromTimestampToMonthYear } from '../../core/utils/DateUtil'\n\nimport { NetWorth } from '../../core/types/NetWorth'\n\ninterface NetWorthListItemProps {\n item: NetWorth\n getStyles: (item: NetWorth) => { backgroundColor: string; borderBottom: string; color: string }\n isHovered: boolean\n isSelected: boolean\n onItemClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter: (dataIndex: number) => void\n onMouseLeave: () => void\n}\n\nconst NetWorthListItem: React.FC<NetWorthListItemProps> = ({\n item: dataPoint,\n getStyles,\n isHovered = false,\n isSelected = false,\n onItemClick,\n onMouseEnter,\n onMouseLeave,\n}) => {\n const [listItemStyles, setListItemStyles] = React.useState({\n color: '',\n })\n\n React.useEffect(() => {\n setListItemStyles(getStyles(dataPoint))\n }, [isHovered, isSelected])\n\n return (\n <React.Fragment key={dataPoint.x}>\n <ListItem\n sx={{\n ...listItemStyles,\n minHeight: 44,\n '&:hover': { color: isSelected ? 'inherit' : listItemStyles.color },\n }}\n >\n <ListItemButton\n onClick={(event) => onItemClick?.(event, dataPoint.x)}\n
|
|
1
|
+
{"version":3,"file":"NetWorthListItem.es.js","names":[],"sources":["../../../src/networth/components/NetWorthListItem.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Divider from '@mui/material/Divider'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { CurrencyText } from '../../common/'\nimport { mouseOnly } from '../../common/utils/MouseOnly'\n\nimport { fromTimestampToMonthYear } from '../../core/utils/DateUtil'\n\nimport { NetWorth } from '../../core/types/NetWorth'\n\ninterface NetWorthListItemProps {\n item: NetWorth\n getStyles: (item: NetWorth) => { backgroundColor: string; borderBottom: string; color: string }\n isHovered: boolean\n isSelected: boolean\n onItemClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter: (dataIndex: number) => void\n onMouseLeave: () => void\n}\n\nconst NetWorthListItem: React.FC<NetWorthListItemProps> = ({\n item: dataPoint,\n getStyles,\n isHovered = false,\n isSelected = false,\n onItemClick,\n onMouseEnter,\n onMouseLeave,\n}) => {\n const [listItemStyles, setListItemStyles] = React.useState({\n color: '',\n })\n\n React.useEffect(() => {\n setListItemStyles(getStyles(dataPoint))\n }, [isHovered, isSelected])\n\n return (\n <React.Fragment key={dataPoint.x}>\n <ListItem\n sx={{\n ...listItemStyles,\n minHeight: 44,\n '&:hover': { color: isSelected ? 'inherit' : listItemStyles.color },\n }}\n >\n <ListItemButton\n onClick={(event) => onItemClick?.(event, dataPoint.x)}\n onPointerEnter={mouseOnly(() => onMouseEnter(dataPoint.x))}\n onPointerLeave={mouseOnly(onMouseLeave)}\n sx={{ minHeight: 20, padding: 12 }}\n >\n <ListItemText\n primary={\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ fontWeight: 400 }}>\n <Text variant=\"body1\">{fromTimestampToMonthYear(dataPoint.x)}</Text>\n <CurrencyText amount={dataPoint.y} sx={{ color: 'inherit' }} variant=\"body1\" />\n </Stack>\n }\n />\n </ListItemButton>\n </ListItem>\n <Divider />\n </React.Fragment>\n )\n}\n\nexport default observer(NetWorthListItem)\n"],"mappings":";;;;;;;;;;;;AA4BA,IAAM,IAAA,CAAqD,EACzD,MAAM,GACN,WAAA,GACA,WAAA,IAAY,IACZ,YAAA,IAAa,IACb,aAAA,GACA,cAAA,GACA,cAAA,EAAA,MACI;AACJ,QAAM,CAAC,GAAgB,CAAA,IAAqB,EAAM,SAAS,EACzD,OAAO,GACT,CAAC;AAED,SAAA,EAAM,UAAA,MAAgB;AACpB,IAAA,EAAkB,EAAU,CAAS,CAAC;AAAA,EACxC,GAAG,CAAC,GAAW,CAAU,CAAC,GAGxB,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,GAAG;AAAA,MACH,WAAW;AAAA,MACX,WAAW,EAAE,OAAO,IAAa,YAAY,EAAe,MAAM;AAAA,IACpE;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,SAAA,CAAU,MAAU,IAAc,GAAO,EAAU,CAAC;AAAA,MACpD,gBAAgB,EAAA,MAAgB,EAAa,EAAU,CAAC,CAAC;AAAA,MACzD,gBAAgB,EAAU,CAAY;AAAA,MACtC,IAAI;AAAA,QAAE,WAAW;AAAA,QAAI,SAAS;AAAA,MAAG;AAAA,MAEjC,UAAA,gBAAA,EAAC,GAAD,EACE,SACE,gBAAA,EAAC,GAAD;AAAA,QAAO,WAAU;AAAA,QAAM,gBAAe;AAAA,QAAgB,I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