@mx-cartographer/experiences 9.4.47 → 9.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/budgets/components/addbudget/UnbudgetedRow.es.js +32 -31
- package/dist/budgets/components/addbudget/UnbudgetedRow.es.js.map +1 -1
- package/dist/common/components/dialog/Dialog.d.ts +2 -0
- package/dist/common/components/dialog/Dialog.es.js +40 -56
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/common/components/drawer/Drawer.es.js +61 -51
- package/dist/common/components/drawer/Drawer.es.js.map +1 -1
- package/dist/common/hooks/useFocusReturn.d.ts +7 -0
- package/dist/common/hooks/useFocusReturn.es.js +31 -0
- package/dist/common/hooks/useFocusReturn.es.js.map +1 -0
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js +49 -47
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [9.4.49] - 10-01-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Category rule dialog now receives screen reader focus when it opens from the category drawer (MEW-4017)
|
|
4
|
+
|
|
5
|
+
## [9.4.48] - 09-30-2026
|
|
6
|
+
|
|
7
|
+
- **FIXED** - Add Budget drawer category list no longer renders non-list-item elements directly inside the `<ul>` (MEW-4121)
|
|
8
|
+
|
|
1
9
|
## [9.4.47] - 09-30-2026
|
|
2
10
|
|
|
3
11
|
- **FIXED** - Confirmation dialogs now return screen reader focus to the row that opened them instead of stranding it (MEW-4016)
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { useGlobalCopyStore as p } from "../../../common/context/hooks.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { BudgetAmount as
|
|
5
|
-
import
|
|
6
|
-
import { observer as
|
|
7
|
-
import { CategoryIcon as
|
|
8
|
-
import { jsx as o, jsxs as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
var w =
|
|
15
|
-
const { budgets:
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
2
|
+
import c from "../../../common/components/dialog/Dialog.es.js";
|
|
3
|
+
import { formatCurrency as f } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { BudgetAmount as A } from "../shared/BudgetAmount.es.js";
|
|
5
|
+
import n from "react";
|
|
6
|
+
import { observer as b } from "mobx-react-lite";
|
|
7
|
+
import { CategoryIcon as I, Icon as y } from "@mxenabled/mxui";
|
|
8
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
9
|
+
import C from "@mui/material/ListItem";
|
|
10
|
+
import h from "@mui/material/ListItemAvatar";
|
|
11
|
+
import _ from "@mui/material/ListItemButton";
|
|
12
|
+
import x from "@mui/material/ListItemText";
|
|
13
|
+
import B from "@mui/material/ListItemSecondaryAction";
|
|
14
|
+
var w = b(({ category: t, onAddBudget: s }) => {
|
|
15
|
+
const { budgets: m, common: d } = p(), [u, r] = n.useState(!1), [e, l] = n.useState(`${t.totalAmount === 0 ? "" : t.totalAmount}`), i = f(t.totalAmount, "0,0");
|
|
16
|
+
return /* @__PURE__ */ a(C, { children: [/* @__PURE__ */ a(_, {
|
|
17
|
+
"aria-label": `${m.add_title}: ${t.name}, ${i}`,
|
|
18
|
+
onClick: () => r(!0),
|
|
18
19
|
children: [
|
|
19
|
-
/* @__PURE__ */ o(
|
|
20
|
-
/* @__PURE__ */ o(
|
|
20
|
+
/* @__PURE__ */ o(h, { children: /* @__PURE__ */ o(I, { categoryGuid: t.guid }) }),
|
|
21
|
+
/* @__PURE__ */ o(x, {
|
|
21
22
|
primary: t.name,
|
|
22
|
-
secondary:
|
|
23
|
+
secondary: i
|
|
23
24
|
}),
|
|
24
|
-
/* @__PURE__ */ o(
|
|
25
|
+
/* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(y, {
|
|
25
26
|
name: "add",
|
|
26
27
|
size: 20
|
|
27
28
|
}) })
|
|
28
29
|
]
|
|
29
|
-
})
|
|
30
|
+
}), /* @__PURE__ */ o(c, {
|
|
30
31
|
copy: {
|
|
31
|
-
close_aria:
|
|
32
|
-
title:
|
|
32
|
+
close_aria: d.close_aria,
|
|
33
|
+
title: m.add_title
|
|
33
34
|
},
|
|
34
|
-
disablePrimaryButton: Number(
|
|
35
|
-
isOpen:
|
|
36
|
-
onClose: () =>
|
|
37
|
-
onPrimaryAction: () =>
|
|
38
|
-
primaryText:
|
|
39
|
-
children: /* @__PURE__ */ o(
|
|
40
|
-
amount:
|
|
35
|
+
disablePrimaryButton: Number(e) <= 0,
|
|
36
|
+
isOpen: u,
|
|
37
|
+
onClose: () => r(!1),
|
|
38
|
+
onPrimaryAction: () => s(t, Number(e)),
|
|
39
|
+
primaryText: m.add_save_button,
|
|
40
|
+
children: /* @__PURE__ */ o(A, {
|
|
41
|
+
amount: e,
|
|
41
42
|
categoryName: t.name,
|
|
42
|
-
onAmountChanged:
|
|
43
|
+
onAmountChanged: l
|
|
43
44
|
})
|
|
44
45
|
})] });
|
|
45
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnbudgetedRow.es.js","names":[],"sources":["../../../../src/budgets/components/addbudget/UnbudgetedRow.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction'\nimport ListItemText from '@mui/material/ListItemText'\n\nimport { CategoryIcon, Icon } from '@mxenabled/mxui'\n\nimport { Dialog, useGlobalCopyStore } from '../../../common'\nimport { type DetailedCategory } from '../../../core'\n\nimport { BudgetAmount } from '../shared/BudgetAmount'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface UnbudgetedRowProps {\n category: DetailedCategory\n onAddBudget: (category: DetailedCategory, amount: number) => void\n}\n\nexport const UnbudgetedRow: React.FC<UnbudgetedRowProps> = observer(({ category, onAddBudget }) => {\n const { budgets: copy, common: commonCopy } = useGlobalCopyStore()\n\n const [isAddBudgetOpen, setIsAddBudgetOpen] = React.useState(false)\n const [amount, setAmount] = React.useState(\n `${category.totalAmount === 0 ? '' : category.totalAmount}`,\n )\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"UnbudgetedRow.es.js","names":[],"sources":["../../../../src/budgets/components/addbudget/UnbudgetedRow.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction'\nimport ListItemText from '@mui/material/ListItemText'\n\nimport { CategoryIcon, Icon } from '@mxenabled/mxui'\n\nimport { Dialog, useGlobalCopyStore } from '../../../common'\nimport { type DetailedCategory } from '../../../core'\n\nimport { BudgetAmount } from '../shared/BudgetAmount'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface UnbudgetedRowProps {\n category: DetailedCategory\n onAddBudget: (category: DetailedCategory, amount: number) => void\n}\n\nexport const UnbudgetedRow: React.FC<UnbudgetedRowProps> = observer(({ category, onAddBudget }) => {\n const { budgets: copy, common: commonCopy } = useGlobalCopyStore()\n\n const [isAddBudgetOpen, setIsAddBudgetOpen] = React.useState(false)\n const [amount, setAmount] = React.useState(\n `${category.totalAmount === 0 ? '' : category.totalAmount}`,\n )\n\n const formattedAmount = formatCurrency(category.totalAmount, '0,0')\n\n return (\n <ListItem>\n <ListItemButton\n aria-label={`${copy.add_title}: ${category.name}, ${formattedAmount}`}\n onClick={() => setIsAddBudgetOpen(true)}\n >\n <ListItemAvatar>\n <CategoryIcon categoryGuid={category.guid} />\n </ListItemAvatar>\n <ListItemText primary={category.name} secondary={formattedAmount} />\n <ListItemSecondaryAction>\n <Icon name=\"add\" size={20} />\n </ListItemSecondaryAction>\n </ListItemButton>\n <Dialog\n copy={{ close_aria: commonCopy.close_aria, title: copy.add_title }}\n disablePrimaryButton={Number(amount) <= 0}\n isOpen={isAddBudgetOpen}\n onClose={() => setIsAddBudgetOpen(false)}\n onPrimaryAction={() => onAddBudget(category, Number(amount))}\n primaryText={copy.add_save_button}\n >\n <BudgetAmount amount={amount} categoryName={category.name} onAmountChanged={setAmount} />\n </Dialog>\n </ListItem>\n )\n})\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAa,IAA8C,EAAA,CAAU,EAAE,UAAA,GAAU,aAAA,EAAA,MAAkB;AACjG,QAAM,EAAE,SAAS,GAAM,QAAQ,EAAA,IAAe,EAAmB,GAE3D,CAAC,GAAiB,CAAA,IAAsB,EAAM,SAAS,EAAK,GAC5D,CAAC,GAAQ,CAAA,IAAa,EAAM,SAChC,GAAG,EAAS,gBAAgB,IAAI,KAAK,EAAS,WAAA,EAChD,GAEM,IAAkB,EAAe,EAAS,aAAa,KAAK;AAElE,SACE,gBAAA,EAAC,GAAD,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,cAAY,GAAG,EAAK,SAAA,KAAc,EAAS,IAAA,KAAS,CAAA;AAAA,IACpD,SAAA,MAAe,EAAmB,EAAI;AAAA,IAFxC,UAAA;AAAA,MAIE,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD,EAAc,cAAc,EAAS,KAAO,CAAA,EAC9B,CAAA;AAAA,MAChB,gBAAA,EAAC,GAAD;AAAA,QAAc,SAAS,EAAS;AAAA,QAAM,WAAW;AAAA,MAAkB,CAAA;AAAA,MACnE,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAK;AAAA,QAAM,MAAM;AAAA,MAAK,CAAA,EACL,CAAA;AAAA,IACX;AAAA,EAChB,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM;AAAA,MAAE,YAAY,EAAW;AAAA,MAAY,OAAO,EAAK;AAAA,IAAU;AAAA,IACjE,sBAAsB,OAAO,CAAM,KAAK;AAAA,IACxC,QAAQ;AAAA,IACR,SAAA,MAAe,EAAmB,EAAK;AAAA,IACvC,iBAAA,MAAuB,EAAY,GAAU,OAAO,CAAM,CAAC;AAAA,IAC3D,aAAa,EAAK;AAAA,IAElB,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAsB,QAAA;AAAA,MAAQ,cAAc,EAAS;AAAA,MAAM,iBAAiB;AAAA,IAAY,CAAA;AAAA,EAClF,CAAA,CACA,EAAA,CAAA;AAEd,CAAC"}
|
|
@@ -15,6 +15,8 @@ export interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {
|
|
|
15
15
|
onSecondaryAction?: () => void;
|
|
16
16
|
primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
17
17
|
primaryText?: string;
|
|
18
|
+
/** Where focus goes on close. Takes precedence over the element that opened the dialog. */
|
|
19
|
+
returnFocusTo?: React.RefObject<HTMLElement | null>;
|
|
18
20
|
secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
19
21
|
secondaryText?: string;
|
|
20
22
|
}
|
|
@@ -1,79 +1,63 @@
|
|
|
1
|
-
import { useScreenSize as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
s.current = e instanceof HTMLElement && e !== document.body && !a.current?.contains(e) ? e : null;
|
|
14
|
-
}, [c]);
|
|
15
|
-
const H = (e) => {
|
|
16
|
-
const { relatedTarget: t } = e;
|
|
17
|
-
o.current === null && t instanceof HTMLElement && !e.currentTarget.contains(t) && (o.current = t);
|
|
18
|
-
}, d = () => {
|
|
19
|
-
const e = o.current ?? s.current;
|
|
20
|
-
if (o.current = null, s.current = null, !e?.isConnected) return;
|
|
21
|
-
const t = e.ownerDocument.activeElement;
|
|
22
|
-
(!t || t === e.ownerDocument.body || a.current?.contains(t)) && e.focus();
|
|
1
|
+
import { useScreenSize as R } from "../../hooks/useScreenSize.es.js";
|
|
2
|
+
import { useFocusReturn as H } from "../../hooks/useFocusReturn.es.js";
|
|
3
|
+
import j from "react";
|
|
4
|
+
import { DialogFooter as k, DialogHeader as v } from "@mxenabled/mxui";
|
|
5
|
+
import { jsx as o, jsxs as C } from "react/jsx-runtime";
|
|
6
|
+
import I from "@mui/material/Dialog";
|
|
7
|
+
import W from "@mui/material/DialogContent";
|
|
8
|
+
var B = ({ className: l, copy: i, disablePrimaryButton: n = !1, isOpen: e = !1, onClose: r, onPrimaryAction: c, primaryColor: m = "primary", primaryText: d = "Confirm", returnFocusTo: u, onSecondaryAction: t, secondaryColor: p = "primary", secondaryText: f = "Cancel", children: g, ...x }) => {
|
|
9
|
+
const { sx: a, ...h } = x, D = i?.title ?? "", b = i?.close_aria ?? "Close", s = j.useId(), { isSmallMobile: y } = R(), { onExited: P, onFocus: S, rootRef: A } = H(e, u), F = () => {
|
|
10
|
+
c?.(), r();
|
|
11
|
+
}, M = () => {
|
|
12
|
+
t && t(), r();
|
|
23
13
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
u && u(), n();
|
|
29
|
-
};
|
|
30
|
-
return /* @__PURE__ */ i("div", {
|
|
31
|
-
className: `mx-cmn-dialog ${p}`,
|
|
32
|
-
children: /* @__PURE__ */ L(j, {
|
|
33
|
-
"aria-labelledby": f,
|
|
14
|
+
return /* @__PURE__ */ o("div", {
|
|
15
|
+
className: `mx-cmn-dialog ${l}`,
|
|
16
|
+
children: /* @__PURE__ */ C(I, {
|
|
17
|
+
"aria-labelledby": s,
|
|
34
18
|
maxWidth: "xs",
|
|
35
|
-
onClose:
|
|
36
|
-
open:
|
|
19
|
+
onClose: r,
|
|
20
|
+
open: e,
|
|
37
21
|
sx: [{
|
|
38
22
|
"& .MuiDialog-paperScrollPaper": { backgroundColor: "background.default" },
|
|
39
|
-
...
|
|
23
|
+
...y && { "& .MuiDialog-paper": { minWidth: "100%" } },
|
|
40
24
|
height: "100%"
|
|
41
|
-
}, ...
|
|
42
|
-
...
|
|
25
|
+
}, ...a ? [a] : []],
|
|
26
|
+
...h,
|
|
43
27
|
disableRestoreFocus: !0,
|
|
44
|
-
onFocus:
|
|
45
|
-
ref:
|
|
46
|
-
slotProps: { transition: { onExited:
|
|
28
|
+
onFocus: S,
|
|
29
|
+
ref: A,
|
|
30
|
+
slotProps: { transition: { onExited: P } },
|
|
47
31
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ o(v, {
|
|
49
33
|
ariaHidden: !0,
|
|
50
34
|
copy: {
|
|
51
|
-
title:
|
|
52
|
-
close_aria:
|
|
35
|
+
title: D,
|
|
36
|
+
close_aria: b
|
|
53
37
|
},
|
|
54
|
-
id:
|
|
55
|
-
onClose:
|
|
38
|
+
id: s,
|
|
39
|
+
onClose: r,
|
|
56
40
|
truncate: !0
|
|
57
41
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ o(W, {
|
|
59
43
|
sx: { lineHeight: 1.5 },
|
|
60
|
-
children:
|
|
44
|
+
children: g
|
|
61
45
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
isPrimaryDisabled:
|
|
64
|
-
onPrimaryAction:
|
|
65
|
-
onSecondaryAction:
|
|
66
|
-
primaryColor:
|
|
67
|
-
primaryText:
|
|
68
|
-
secondaryColor:
|
|
69
|
-
secondaryText:
|
|
46
|
+
/* @__PURE__ */ o(k, {
|
|
47
|
+
isPrimaryDisabled: n,
|
|
48
|
+
onPrimaryAction: F,
|
|
49
|
+
onSecondaryAction: M,
|
|
50
|
+
primaryColor: m,
|
|
51
|
+
primaryText: d,
|
|
52
|
+
secondaryColor: p,
|
|
53
|
+
secondaryText: f
|
|
70
54
|
})
|
|
71
55
|
]
|
|
72
56
|
})
|
|
73
57
|
});
|
|
74
58
|
};
|
|
75
59
|
export {
|
|
76
|
-
|
|
60
|
+
B as default
|
|
77
61
|
};
|
|
78
62
|
|
|
79
63
|
//# sourceMappingURL=Dialog.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n // Label the dialog *by* its visible heading (WAI-ARIA APG) instead of a duplicate\n // aria-label, so screen readers announce the title once rather than name + heading.\n const titleId = React.useId()\n\n const { isSmallMobile } = useScreenSize()\n\n const
|
|
1
|
+
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n // Label the dialog *by* its visible heading (WAI-ARIA APG) instead of a duplicate\n // aria-label, so screen readers announce the title once rather than name + heading.\n const titleId = React.useId()\n\n const { isSmallMobile } = useScreenSize()\n\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen, returnFocusTo)\n\n const handlePrimaryAction = () => {\n onPrimaryAction?.()\n onClose()\n }\n\n const handleSecondaryAction = () => {\n if (onSecondaryAction) {\n onSecondaryAction()\n }\n onClose()\n }\n\n return (\n <div className={`mx-cmn-dialog ${className}`}>\n <MuiDialog\n aria-labelledby={titleId}\n maxWidth=\"xs\"\n onClose={onClose}\n open={isOpen}\n sx={\n [\n {\n '& .MuiDialog-paperScrollPaper': { backgroundColor: 'background.default' },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n height: '100%',\n },\n ...(restSx ? [restSx] : []),\n ] as SxProps\n }\n {...restProps}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{ transition: { onExited } }}\n >\n <DialogHeader\n ariaHidden={true}\n copy={{ title, close_aria: closeAria }}\n id={titleId}\n onClose={onClose}\n truncate={true}\n />\n\n <DialogContent sx={{ lineHeight: 1.5 }}>{children}</DialogContent>\n\n <DialogFooter\n isPrimaryDisabled={disablePrimaryButton}\n onPrimaryAction={handlePrimaryAction}\n onSecondaryAction={handleSecondaryAction}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n </MuiDialog>\n </div>\n )\n}\n\nexport default Dialog\n"],"mappings":";;;;;;;AAyCA,IAAM,IAAA,CAA0D,EAC9D,WAAA,GACA,MAAA,GACA,sBAAA,IAAuB,IACvB,QA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CAAA;AAAA,QAED,gBAAA,EAAC,GAAD;AAAA,UAAe,IAAI,EAAE,YAAY,IAAI;AAAA,UAAI,UAAA;AAAA,QAAwB,CAAA;AAAA,QAEjE,gBAAA,EAAC,GAAD;AAAA,UACE,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,UACjB,mBAAmB;AAAA,UACL,cAAA;AAAA,UACD,aAAA;AAAA,UACG,gBAAA;AAAA,UACD,eAAA;AAAA,QAChB,CAAA;AAAA,MACQ;AAAA;EACR,CAAA;AAET"}
|
|
@@ -1,57 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { useFocusReturn as y } from "../../hooks/useFocusReturn.es.js";
|
|
2
|
+
import D from "./Footer.es.js";
|
|
3
|
+
import F from "./Header.es.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import
|
|
5
|
-
import { Drawer as
|
|
6
|
-
import { jsx as r, jsxs as
|
|
7
|
-
import
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
import j from "@mui/material/Stack";
|
|
6
|
+
import { Drawer as C } from "@mxenabled/mxui";
|
|
7
|
+
import { jsx as r, jsxs as v } from "react/jsx-runtime";
|
|
8
|
+
import B from "@mui/material/Box";
|
|
9
|
+
var G = ({ ariaLabelClose: s = "Close", children: u, footerStyles: d = {}, hasSecondaryAction: i = !0, id: p, isOpen: e, isPrimaryDisabled: c, onClose: o, onPrimaryAction: t, onSecondaryAction: l, primaryButtonProps: m, primaryColor: f = "primary", primaryText: n, secondaryColor: h = "secondary", secondaryText: b, shouldShowHeaderBorders: w = !0, shouldShowHeaderShadow: g = !1, title: a, ...x }) => {
|
|
10
|
+
const { onExited: k, onFocus: R, rootRef: S } = y(e);
|
|
11
|
+
return /* @__PURE__ */ r(C, {
|
|
12
|
+
id: p,
|
|
13
|
+
isOpen: e,
|
|
14
|
+
onClose: o,
|
|
15
|
+
sx: {
|
|
16
|
+
"& .MuiDrawer-paper": {
|
|
17
|
+
backgroundColor: "background.default",
|
|
18
|
+
borderRadius: 0
|
|
19
|
+
},
|
|
20
|
+
height: "100%",
|
|
21
|
+
"& .MuiToolbar-root": { backgroundColor: "background.paper" }
|
|
17
22
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
23
|
+
...x,
|
|
24
|
+
disableRestoreFocus: !0,
|
|
25
|
+
onFocus: R,
|
|
26
|
+
ref: S,
|
|
27
|
+
slotProps: {
|
|
28
|
+
paper: { "aria-labelledby": `${a?.replace(/\s+/g, "-").toLowerCase()}-header-title` },
|
|
29
|
+
transition: { onExited: k }
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ v(j, {
|
|
32
|
+
height: "100%",
|
|
33
|
+
justifyContent: "space-between",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ r(F, {
|
|
36
|
+
ariaLabelClose: s,
|
|
37
|
+
onClose: o,
|
|
38
|
+
shouldShowBorders: w,
|
|
39
|
+
shouldShowShadow: g,
|
|
40
|
+
title: a
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ r(B, {
|
|
43
|
+
height: "100%",
|
|
44
|
+
overflow: "auto",
|
|
45
|
+
children: u
|
|
46
|
+
}),
|
|
47
|
+
t && /* @__PURE__ */ r(D, {
|
|
48
|
+
footerStyles: d,
|
|
49
|
+
hasSecondaryAction: i,
|
|
50
|
+
isPrimaryDisabled: c,
|
|
51
|
+
onPrimaryAction: t,
|
|
52
|
+
onSecondaryAction: l ?? o,
|
|
53
|
+
primaryButtonProps: m,
|
|
54
|
+
primaryColor: f,
|
|
55
|
+
primaryText: n,
|
|
56
|
+
secondaryColor: h,
|
|
57
|
+
secondaryText: b
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
};
|
|
53
63
|
export {
|
|
54
|
-
|
|
64
|
+
G as default
|
|
55
65
|
};
|
|
56
66
|
|
|
57
67
|
//# sourceMappingURL=Drawer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.es.js","names":[],"sources":["../../../../src/common/components/drawer/Drawer.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Drawer as KMuiDrawer } from '@mxenabled/mxui'\n\nimport Footer from './Footer'\nimport Header from './Header'\n\nexport type CopyObject = {\n close_drawer_aria: string\n}\n\ninterface DrawerProps {\n ariaLabelClose?: string\n className?: string\n footerStyles?: SxProps\n hasSecondaryAction?: boolean\n id?: string\n isOpen: boolean\n isPrimaryDisabled?: boolean\n onClose: () => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryButtonProps?: React.ComponentProps<typeof Button>\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n shouldShowHeaderBorders?: boolean\n shouldShowHeaderShadow?: boolean\n sx?: SxProps\n title: string\n}\n\nconst Drawer: React.FC<React.PropsWithChildren<DrawerProps>> = ({\n ariaLabelClose = 'Close',\n children,\n footerStyles = {},\n hasSecondaryAction = true,\n id,\n isOpen,\n isPrimaryDisabled,\n onClose,\n onPrimaryAction,\n onSecondaryAction,\n primaryButtonProps,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'secondary',\n secondaryText,\n shouldShowHeaderBorders = true,\n shouldShowHeaderShadow = false,\n title,\n ...rest\n}) => {\n return (\n <KMuiDrawer\n id={id}\n isOpen={isOpen}\n onClose={onClose}\n
|
|
1
|
+
{"version":3,"file":"Drawer.es.js","names":[],"sources":["../../../../src/common/components/drawer/Drawer.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Drawer as KMuiDrawer } from '@mxenabled/mxui'\n\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nimport Footer from './Footer'\nimport Header from './Header'\n\nexport type CopyObject = {\n close_drawer_aria: string\n}\n\ninterface DrawerProps {\n ariaLabelClose?: string\n className?: string\n footerStyles?: SxProps\n hasSecondaryAction?: boolean\n id?: string\n isOpen: boolean\n isPrimaryDisabled?: boolean\n onClose: () => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryButtonProps?: React.ComponentProps<typeof Button>\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n shouldShowHeaderBorders?: boolean\n shouldShowHeaderShadow?: boolean\n sx?: SxProps\n title: string\n}\n\nconst Drawer: React.FC<React.PropsWithChildren<DrawerProps>> = ({\n ariaLabelClose = 'Close',\n children,\n footerStyles = {},\n hasSecondaryAction = true,\n id,\n isOpen,\n isPrimaryDisabled,\n onClose,\n onPrimaryAction,\n onSecondaryAction,\n primaryButtonProps,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'secondary',\n secondaryText,\n shouldShowHeaderBorders = true,\n shouldShowHeaderShadow = false,\n title,\n ...rest\n}) => {\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen)\n\n return (\n <KMuiDrawer\n id={id}\n isOpen={isOpen}\n onClose={onClose}\n sx={{\n '& .MuiDrawer-paper': {\n backgroundColor: 'background.default',\n borderRadius: 0,\n },\n height: '100%',\n '& .MuiToolbar-root': {\n backgroundColor: 'background.paper',\n },\n }}\n {...rest}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{\n paper: {\n 'aria-labelledby': `${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`,\n },\n transition: { onExited },\n }}\n >\n <Stack height=\"100%\" justifyContent=\"space-between\">\n <Header\n ariaLabelClose={ariaLabelClose}\n onClose={onClose}\n shouldShowBorders={shouldShowHeaderBorders}\n shouldShowShadow={shouldShowHeaderShadow}\n title={title}\n />\n\n <Box height=\"100%\" overflow=\"auto\">\n {children}\n </Box>\n\n {onPrimaryAction && (\n <Footer\n footerStyles={footerStyles}\n hasSecondaryAction={hasSecondaryAction}\n isPrimaryDisabled={isPrimaryDisabled}\n onPrimaryAction={onPrimaryAction}\n onSecondaryAction={onSecondaryAction ?? onClose}\n primaryButtonProps={primaryButtonProps}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </Stack>\n </KMuiDrawer>\n )\n}\n\nexport default Drawer\n"],"mappings":";;;;;;;;AAwCA,IAAM,IAAA,CAA0D,EAC9D,gBAAA,IAAiB,SACjB,UAAA,GACA,cAAA,IAAe,CAAC,GAChB,oBAAA,IAAqB,IACrB,IAAA,GACA,QAAA,GACA,mBAAA,GACA,SAAA,GACA,iBAAA,GACA,mBAAA,GACA,oBAAA,GACA,cAAA,IAAe,WACf,aAAA,GACA,gBAAA,IAAiB,aACjB,eAAA,GACA,yBAAA,IAA0B,IAC1B,wBAAA,IAAyB,IACzB,OAAA,GACA,GAAG,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us to a modal's opener after its exit transition. Requires `disableRestoreFocus` on the modal. */
|
|
3
|
+
export declare const useFocusReturn: (isOpen: boolean, returnFocusTo?: React.RefObject<HTMLElement | null>) => {
|
|
4
|
+
onExited: () => void;
|
|
5
|
+
onFocus: (event: React.FocusEvent<HTMLElement>) => void;
|
|
6
|
+
rootRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import n from "react";
|
|
2
|
+
var m = (s, l) => {
|
|
3
|
+
const c = n.useRef(null), r = n.useRef(null), u = n.useRef(null);
|
|
4
|
+
n.useLayoutEffect(() => {
|
|
5
|
+
if (!s) return;
|
|
6
|
+
r.current = null;
|
|
7
|
+
const e = document.activeElement;
|
|
8
|
+
u.current = e instanceof HTMLElement && e !== document.body && !c.current?.contains(e) ? e : null;
|
|
9
|
+
}, [s]);
|
|
10
|
+
const a = (e) => {
|
|
11
|
+
const { relatedTarget: t } = e;
|
|
12
|
+
r.current === null && t instanceof HTMLElement && !e.currentTarget.contains(t) && (r.current = t);
|
|
13
|
+
}, o = () => {
|
|
14
|
+
const e = l?.current ?? r.current ?? u.current;
|
|
15
|
+
if (r.current = null, u.current = null, !e?.isConnected) return;
|
|
16
|
+
const t = e.ownerDocument.activeElement;
|
|
17
|
+
(!t || t === e.ownerDocument.body || c.current?.contains(t)) && e.focus();
|
|
18
|
+
}, f = n.useRef(o);
|
|
19
|
+
return n.useLayoutEffect(() => {
|
|
20
|
+
f.current = o;
|
|
21
|
+
}), n.useEffect(() => () => queueMicrotask(() => f.current()), []), {
|
|
22
|
+
onExited: o,
|
|
23
|
+
onFocus: a,
|
|
24
|
+
rootRef: c
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
m as useFocusReturn
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=useFocusReturn.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusReturn.es.js","names":[],"sources":["../../../src/common/hooks/useFocusReturn.ts"],"sourcesContent":["import React from 'react'\n\n/** Restores focus to a modal's opener after its exit transition. Requires `disableRestoreFocus` on the modal. */\nexport const useFocusReturn = (\n isOpen: boolean,\n returnFocusTo?: React.RefObject<HTMLElement | null>,\n) => {\n const rootRef = React.useRef<HTMLDivElement>(null)\n const openerRef = React.useRef<HTMLElement | null>(null)\n const openerSnapshotRef = React.useRef<HTMLElement | null>(null)\n\n React.useLayoutEffect(() => {\n if (!isOpen) return\n openerRef.current = null\n const active = document.activeElement\n openerSnapshotRef.current =\n active instanceof HTMLElement &&\n active !== document.body &&\n !rootRef.current?.contains(active)\n ? active\n : null\n }, [isOpen])\n\n const onFocus = (event: React.FocusEvent<HTMLElement>) => {\n const { relatedTarget } = event\n if (\n openerRef.current === null &&\n relatedTarget instanceof HTMLElement &&\n !event.currentTarget.contains(relatedTarget)\n ) {\n openerRef.current = relatedTarget\n }\n }\n\n const restoreFocus = () => {\n const target = returnFocusTo?.current ?? openerRef.current ?? openerSnapshotRef.current\n openerRef.current = null\n openerSnapshotRef.current = null\n if (!target?.isConnected) return\n\n const active = target.ownerDocument.activeElement\n const focusIsUnclaimed =\n !active || active === target.ownerDocument.body || Boolean(rootRef.current?.contains(active))\n if (focusIsUnclaimed) {\n target.focus()\n }\n }\n\n const restoreFocusRef = React.useRef(restoreFocus)\n React.useLayoutEffect(() => {\n restoreFocusRef.current = restoreFocus\n })\n\n React.useEffect(() => () => queueMicrotask(() => restoreFocusRef.current()), [])\n\n return { onExited: restoreFocus, onFocus, rootRef }\n}\n"],"mappings":";AAGA,IAAa,IAAA,CACX,GACA,MACG;AACH,QAAM,IAAU,EAAM,OAAuB,IAAI,GAC3C,IAAY,EAAM,OAA2B,IAAI,GACjD,IAAoB,EAAM,OAA2B,IAAI;AAE/D,EAAA,EAAM,gBAAA,MAAsB;AAC1B,QAAI,CAAC,EAAQ;AACb,IAAA,EAAU,UAAU;AACpB,UAAM,IAAS,SAAS;AACxB,IAAA,EAAkB,UAChB,aAAkB,eAClB,MAAW,SAAS,QACpB,CAAC,EAAQ,SAAS,SAAS,CAAM,IAC7B,IACA;AAAA,EACR,GAAG,CAAC,CAAM,CAAC;AAEX,QAAM,IAAA,CAAW,MAAyC;AACxD,UAAM,EAAE,eAAA,EAAA,IAAkB;AAC1B,IACE,EAAU,YAAY,QACtB,aAAyB,eACzB,CAAC,EAAM,cAAc,SAAS,CAAa,MAE3C,EAAU,UAAU;AAAA,EAExB,GAEM,IAAA,MAAqB;AACzB,UAAM,IAAS,GAAe,WAAW,EAAU,WAAW,EAAkB;AAGhF,QAFA,EAAU,UAAU,MACpB,EAAkB,UAAU,MACxB,CAAC,GAAQ,YAAa;AAE1B,UAAM,IAAS,EAAO,cAAc;AAGpC,KADE,CAAC,KAAU,MAAW,EAAO,cAAc,QAAgB,EAAQ,SAAS,SAAS,CAAM,MAE3F,EAAO,MAAM;AAAA,EAEjB,GAEM,IAAkB,EAAM,OAAO,CAAY;AACjD,SAAA,EAAM,gBAAA,MAAsB;AAC1B,IAAA,EAAgB,UAAU;AAAA,EAC5B,CAAC,GAED,EAAM,UAAA,MAAA,MAAsB,eAAA,MAAqB,EAAgB,QAAQ,CAAC,GAAG,CAAC,CAAC,GAExE;AAAA,IAAE,UAAU;AAAA,IAAc,SAAA;AAAA,IAAS,SAAA;AAAA,EAAQ;AACpD"}
|
|
@@ -1,63 +1,64 @@
|
|
|
1
1
|
import { buildDynamicCopy as _ } from "../../../../../core/utils/Localization.es.js";
|
|
2
|
-
import { useCategoryStore as
|
|
3
|
-
import
|
|
4
|
-
import { ANALYTICS_EVENTS as
|
|
5
|
-
import { useTransactionsUiStore as
|
|
6
|
-
import { ON_CLICK_EVENTS as
|
|
2
|
+
import { useCategoryStore as b, useEvent as L, useGlobalCopyStore as E, useTransactionStore as N } from "../../../../../common/context/hooks.es.js";
|
|
3
|
+
import O from "../../../../../common/components/dialog/Dialog.es.js";
|
|
4
|
+
import { ANALYTICS_EVENTS as R } from "../../../../../common/constants/Analytics.es.js";
|
|
5
|
+
import { useTransactionsUiStore as w } from "../../../../context/hooks.es.js";
|
|
6
|
+
import { ON_CLICK_EVENTS as D } from "../../../../constants/OnClickEvents.es.js";
|
|
7
7
|
import G from "../../../../../categories/components/CategorySelectorDrawer.es.js";
|
|
8
|
-
import
|
|
9
|
-
import { CategoryIcon as
|
|
10
|
-
import { Icon as
|
|
8
|
+
import i from "react";
|
|
9
|
+
import { CategoryIcon as P, CategoryIconVariants as K, P as V, Text as Y } from "@mxenabled/mxui";
|
|
10
|
+
import { Icon as j } from "@mxenabled/mx-icons";
|
|
11
11
|
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
12
|
-
import { useTheme as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
12
|
+
import { useTheme as k } from "@mui/material/styles";
|
|
13
|
+
import z from "@mui/material/ListItem";
|
|
14
|
+
import B from "@mui/material/Avatar";
|
|
15
|
+
import M from "@mui/material/ListItemAvatar";
|
|
16
|
+
import U from "@mui/material/ListItemButton";
|
|
17
|
+
import F from "@mui/material/ListItemIcon";
|
|
18
18
|
import W from "@mui/material/ListItemText";
|
|
19
|
-
var
|
|
20
|
-
const { addOrUpdateTransactionRule:
|
|
21
|
-
await
|
|
19
|
+
var de = ({ transaction: e }) => {
|
|
20
|
+
const { addOrUpdateTransactionRule: g, updateTransaction: f } = N(), { categories: s } = b(), { onEvent: c } = L(), { setShouldDisableDrawerScroll: C, updateManualTransaction: T } = w(), { transactions: r } = E(), S = k(), l = i.useRef(null), [h, m] = i.useState(!1), [a, n] = i.useState(""), d = async (o) => {
|
|
21
|
+
await f({
|
|
22
22
|
...e,
|
|
23
23
|
category_guid: a
|
|
24
|
-
}), o && await
|
|
25
|
-
},
|
|
24
|
+
}), o && await g(a, e), n(""), c(R.TRANSACTION_DETAILS_CLICK_CATEGORY, { transaction_guid: e.guid });
|
|
25
|
+
}, I = (o) => {
|
|
26
26
|
if (e.is_manual && !e.guid) {
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const u = s.find((v) => v.guid === o);
|
|
28
|
+
T({
|
|
29
29
|
...e,
|
|
30
|
-
category:
|
|
30
|
+
category: u?.name,
|
|
31
31
|
category_guid: o,
|
|
32
|
-
top_level_category_guid:
|
|
32
|
+
top_level_category_guid: u?.parent_guid || o
|
|
33
33
|
});
|
|
34
|
-
} else
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
return /* @__PURE__ */ y(
|
|
34
|
+
} else n(o);
|
|
35
|
+
p();
|
|
36
|
+
}, p = () => {
|
|
37
|
+
m(!1), C(!1);
|
|
38
|
+
}, x = i.useMemo(() => s.find((o) => o.guid === a), [a]), A = S.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
39
|
+
return /* @__PURE__ */ y(z, {
|
|
40
40
|
disableGutters: !0,
|
|
41
41
|
disablePadding: !0,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */ y(
|
|
43
|
+
/* @__PURE__ */ y(U, {
|
|
44
|
+
ref: l,
|
|
44
45
|
onClick: () => {
|
|
45
|
-
c(
|
|
46
|
+
c(D.ON_TRANSACTION_CATEGORY_CLICK), m(!0);
|
|
46
47
|
},
|
|
47
48
|
children: [
|
|
48
|
-
/* @__PURE__ */ t(
|
|
49
|
-
sx: { bgcolor:
|
|
49
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(B, {
|
|
50
|
+
sx: { bgcolor: A },
|
|
50
51
|
variant: "rounded",
|
|
51
|
-
children: /* @__PURE__ */ t(
|
|
52
|
+
children: /* @__PURE__ */ t(P, {
|
|
52
53
|
categoryGuid: e.top_level_category_guid,
|
|
53
54
|
size: 24,
|
|
54
55
|
sx: { color: "text.primary" },
|
|
55
|
-
variant:
|
|
56
|
+
variant: K.Transparent
|
|
56
57
|
})
|
|
57
58
|
}) }),
|
|
58
59
|
/* @__PURE__ */ t(W, {
|
|
59
60
|
primary: r.category_title,
|
|
60
|
-
secondary: /* @__PURE__ */ t(
|
|
61
|
+
secondary: /* @__PURE__ */ t(Y, {
|
|
61
62
|
bold: !0,
|
|
62
63
|
sx: { color: "text.primary" },
|
|
63
64
|
variant: "body1",
|
|
@@ -69,7 +70,7 @@ var me = ({ transaction: e }) => {
|
|
|
69
70
|
fontWeight: "normal"
|
|
70
71
|
} }
|
|
71
72
|
}),
|
|
72
|
-
/* @__PURE__ */ t(
|
|
73
|
+
/* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(j, {
|
|
73
74
|
name: "chevron_right",
|
|
74
75
|
sx: { color: "text.primary" }
|
|
75
76
|
}) })
|
|
@@ -77,29 +78,30 @@ var me = ({ transaction: e }) => {
|
|
|
77
78
|
}),
|
|
78
79
|
/* @__PURE__ */ t(G, {
|
|
79
80
|
initialSelected: e.category_guid,
|
|
80
|
-
onClose:
|
|
81
|
-
onSelect:
|
|
82
|
-
showDrawer:
|
|
81
|
+
onClose: p,
|
|
82
|
+
onSelect: I,
|
|
83
|
+
showDrawer: h,
|
|
83
84
|
title: r.actions_select_a_category
|
|
84
85
|
}),
|
|
85
|
-
/* @__PURE__ */ t(
|
|
86
|
+
/* @__PURE__ */ t(O, {
|
|
86
87
|
copy: { title: _(r.actions_apply_to_all_transaction_types, e.description) },
|
|
87
88
|
isOpen: !!a,
|
|
88
|
-
onClose: () =>
|
|
89
|
-
onPrimaryAction: () =>
|
|
90
|
-
onSecondaryAction: () =>
|
|
89
|
+
onClose: () => n(""),
|
|
90
|
+
onPrimaryAction: () => d(!0),
|
|
91
|
+
onSecondaryAction: () => d(!1),
|
|
91
92
|
primaryText: r.actions_apply_to_all,
|
|
93
|
+
returnFocusTo: l,
|
|
92
94
|
secondaryText: r.actions_this_time_only,
|
|
93
|
-
children: /* @__PURE__ */ t(
|
|
95
|
+
children: /* @__PURE__ */ t(V, {
|
|
94
96
|
variant: "subtitle1",
|
|
95
|
-
children: _(r.actions_all_past_and_future, e.description,
|
|
97
|
+
children: _(r.actions_all_past_and_future, e.description, x?.name)
|
|
96
98
|
})
|
|
97
99
|
})
|
|
98
100
|
]
|
|
99
101
|
});
|
|
100
102
|
};
|
|
101
103
|
export {
|
|
102
|
-
|
|
104
|
+
de as default
|
|
103
105
|
};
|
|
104
106
|
|
|
105
107
|
//# sourceMappingURL=CategoryAction.es.js.map
|
package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/CategoryAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport Avatar from '@mui/material/Avatar'\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 { CategoryIcon, CategoryIconVariants, P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { CategorySelectorDrawer } from '../../../../../categories'\n\nimport {\n ANALYTICS_EVENTS,\n Dialog,\n useCategoryStore,\n useGlobalCopyStore,\n} from '../../../../../common'\nimport type { Transaction } from '../../../../../core'\n\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { useEvent, useTransactionStore } from '../../../../../common'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface CategoryActionProps {\n transaction: Transaction\n}\n\nconst CategoryAction: React.FC<CategoryActionProps> = ({ transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { categories } = useCategoryStore()\n const { onEvent } = useEvent()\n const { setShouldDisableDrawerScroll, updateManualTransaction } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n\n const [open, setOpen] = React.useState(false)\n const [selectedGuid, setSelectedGuid] = React.useState('')\n\n const handleCategoryChange = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: selectedGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(selectedGuid, transaction)\n }\n setSelectedGuid('')\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_CATEGORY, {\n transaction_guid: transaction.guid,\n })\n }\n\n const handleSelected = (guid: string) => {\n if (transaction.is_manual && !transaction.guid) {\n const category = categories.find((c) => c.guid === guid)\n updateManualTransaction({\n ...transaction,\n category: category?.name,\n category_guid: guid,\n top_level_category_guid: category?.parent_guid || guid,\n })\n } else {\n setSelectedGuid(guid)\n }\n\n handleCloseDrawer()\n }\n\n const handleCloseDrawer = () => {\n setOpen(false)\n setShouldDisableDrawerScroll(false)\n }\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === selectedGuid),\n [selectedGuid],\n )\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_CATEGORY_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n size={24}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.category_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\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 <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={handleCloseDrawer}\n onSelect={handleSelected}\n showDrawer={open}\n title={copy.actions_select_a_category}\n />\n\n <Dialog\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={Boolean(selectedGuid)}\n onClose={() => setSelectedGuid('')}\n onPrimaryAction={() => handleCategoryChange(true)}\n onSecondaryAction={() => handleCategoryChange(false)}\n primaryText={copy.actions_apply_to_all}\n secondaryText={copy.actions_this_time_only}\n >\n <P variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n transaction.description,\n category?.name,\n ) as string\n }\n </P>\n </Dialog>\n </ListItem>\n )\n}\n\nexport default CategoryAction\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,IAAM,KAAA,CAAiD,EAAE,aAAA,EAAA,MAAkB;AACzE,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,YAAA,EAAA,IAAe,EAAiB,GAClC,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,8BAAA,GAA8B,yBAAA,EAAA,IAA4B,EAAuB,GACnF,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,IAAQ,EAAS,GAEjB,CAAC,GAAM,CAAA,IAAW,EAAM,SAAS,EAAK,GACtC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GAEnD,IAAuB,OAAO,MAAwB;AAC1D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;AAAA,IAAa,CAAC,GACnE,KACF,MAAM,EAA2B,GAAc,CAAW,GAE5D,EAAgB,EAAE,GAClB,EAAQ,EAAiB,oCAAoC,EAC3D,kBAAkB,EAAY,KAChC,CAAC;AAAA,EACH,GAEM,IAAA,CAAkB,MAAiB;AACvC,QAAI,EAAY,aAAa,CAAC,EAAY,MAAM;AAC9C,YAAM,IAAW,EAAW,KAAA,CAAM,MAAM,EAAE,SAAS,CAAI;AACvD,MAAA,EAAwB;AAAA,QACtB,GAAG;AAAA,QACH,UAAU,GAAU;AAAA,QACpB,eAAe;AAAA,QACf,yBAAyB,GAAU,eAAe;AAAA,MACpD,CAAC;AAAA,IACH,MACE,CAAA,EAAgB,CAAI;AAGtB,IAAA,EAAkB;AAAA,EACpB,GAEM,IAAA,MAA0B;AAC9B,IAAA,EAAQ,EAAK,GACb,EAA6B,EAAK;AAAA,EACpC,GAEM,IAAW,EAAM,QAAA,MACf,EAAW,KAAA,CAAM,MAAS,EAAK,SAAS,CAAY,GAC1D,CAAC,CAAY,CACf,GAEM,IAAU,EAAM,QAAQ,SAAS,SAAS,aAAa;AAE7D,SACE,gBAAA,EAAC,GAAD;AAAA,IAAU,gBAAgB;AAAA,IAAM,gBAAgB;AAAA,IAAhD,UAAA;AAAA,MACE,gBAAA,EAAC,GAAD;AAAA,QACE,SAAA,MAAe;AACb,UAAA,EAAQ,EAAgB,6BAA6B,GACrD,EAAQ,EAAI;AAAA,QACd;AAAA,
|
|
1
|
+
{"version":3,"file":"CategoryAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/CategoryAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport Avatar from '@mui/material/Avatar'\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 { CategoryIcon, CategoryIconVariants, P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { CategorySelectorDrawer } from '../../../../../categories'\n\nimport {\n ANALYTICS_EVENTS,\n Dialog,\n useCategoryStore,\n useGlobalCopyStore,\n} from '../../../../../common'\nimport type { Transaction } from '../../../../../core'\n\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { useEvent, useTransactionStore } from '../../../../../common'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface CategoryActionProps {\n transaction: Transaction\n}\n\nconst CategoryAction: React.FC<CategoryActionProps> = ({ transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { categories } = useCategoryStore()\n const { onEvent } = useEvent()\n const { setShouldDisableDrawerScroll, updateManualTransaction } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n\n const categoryRowRef = React.useRef<HTMLDivElement>(null)\n const [open, setOpen] = React.useState(false)\n const [selectedGuid, setSelectedGuid] = React.useState('')\n\n const handleCategoryChange = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: selectedGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(selectedGuid, transaction)\n }\n setSelectedGuid('')\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_CATEGORY, {\n transaction_guid: transaction.guid,\n })\n }\n\n const handleSelected = (guid: string) => {\n if (transaction.is_manual && !transaction.guid) {\n const category = categories.find((c) => c.guid === guid)\n updateManualTransaction({\n ...transaction,\n category: category?.name,\n category_guid: guid,\n top_level_category_guid: category?.parent_guid || guid,\n })\n } else {\n setSelectedGuid(guid)\n }\n\n handleCloseDrawer()\n }\n\n const handleCloseDrawer = () => {\n setOpen(false)\n setShouldDisableDrawerScroll(false)\n }\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === selectedGuid),\n [selectedGuid],\n )\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton\n ref={categoryRowRef}\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_CATEGORY_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n size={24}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.category_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\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 <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={handleCloseDrawer}\n onSelect={handleSelected}\n showDrawer={open}\n title={copy.actions_select_a_category}\n />\n\n <Dialog\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={Boolean(selectedGuid)}\n onClose={() => setSelectedGuid('')}\n onPrimaryAction={() => handleCategoryChange(true)}\n onSecondaryAction={() => handleCategoryChange(false)}\n primaryText={copy.actions_apply_to_all}\n returnFocusTo={categoryRowRef}\n secondaryText={copy.actions_this_time_only}\n >\n <P variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n transaction.description,\n category?.name,\n ) as string\n }\n </P>\n </Dialog>\n </ListItem>\n )\n}\n\nexport default CategoryAction\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,IAAM,KAAA,CAAiD,EAAE,aAAA,EAAA,MAAkB;AACzE,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,YAAA,EAAA,IAAe,EAAiB,GAClC,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,8BAAA,GAA8B,yBAAA,EAAA,IAA4B,EAAuB,GACnF,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,IAAQ,EAAS,GAEjB,IAAiB,EAAM,OAAu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