@mx-cartographer/experiences 9.4.24 → 9.4.26
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 +14 -0
- package/dist/accounts/components/AccountListItem.es.js +6 -6
- package/dist/accounts/components/AccountsListCompact.es.js +6 -6
- package/dist/accounts/components/detailsdrawer/Accounts/AccountConnection.es.js +8 -8
- package/dist/budgets/components/addbudget/RecalculateBudgetRow.es.js +5 -5
- package/dist/budgets/components/addbudget/UnbudgetedRow.es.js +6 -6
- package/dist/categories/components/CategoryRow.es.js +8 -8
- package/dist/common/components/DataRow.es.js +9 -9
- package/dist/common/components/GlobalAccountFilter.es.js +115 -90
- package/dist/common/components/GlobalAccountFilter.es.js.map +1 -1
- package/dist/common/components/ListItemRow.es.js +1 -1
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +2 -1
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.es.js +114 -99
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.es.js.map +1 -1
- package/dist/common/components/globalaccountfilter/TriStateCheckbox.d.ts +17 -0
- package/dist/common/components/globalaccountfilter/TriStateCheckbox.es.js +18 -0
- package/dist/common/components/globalaccountfilter/TriStateCheckbox.es.js.map +1 -0
- package/dist/common/components/globalaccountfilter/selection.d.ts +17 -0
- package/dist/common/components/globalaccountfilter/selection.es.js +10 -0
- package/dist/common/components/globalaccountfilter/selection.es.js.map +1 -0
- package/dist/common/components/listitems/CollapseExpandListItem.es.js +4 -4
- package/dist/common/components/listitems/ToggleButtonListItem.es.js +8 -8
- package/dist/core/types/Insights.d.ts +2 -1
- package/dist/core/types/localization/AccountFilterCopy.d.ts +2 -2
- package/dist/finstrong/components/ProfileList.es.js +7 -7
- package/dist/finstrong/components/shared/Accounts.es.js +4 -4
- package/dist/goals/components/AccountSelectionDrawer.es.js +6 -6
- package/dist/goals/components/actions/AccountAction.es.js +4 -4
- package/dist/goals/components/actions/ChangeAccountAction.es.js +1 -1
- package/dist/goals/components/addgoal/AddGoalListItem.es.js +2 -2
- package/dist/goals/components/managegoals/CompleteListItem.es.js +6 -6
- package/dist/goals/components/managegoals/OngoingListItem.es.js +8 -8
- package/dist/help/components/requestsupport/PopularTopicsRow.es.js +8 -8
- package/dist/insights/components/insights/DiscoveredAccounts/DiscoveredAccountsLearnMoreDrawerContent.es.js +6 -6
- package/dist/insights/components/shared/MenuAction.es.js +4 -4
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -37
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +80 -71
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +5 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +61 -53
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.d.ts +3 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +28 -24
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +39 -39
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/OverflowMenu.es.js +4 -4
- package/dist/insights-v2/components/SubHeader.es.js +4 -4
- package/dist/insights-v2/components/SubHeader.es.js.map +1 -1
- package/dist/merchants/components/MerchantLookup.es.js +6 -6
- package/dist/networth/components/AssetsLiabilitiesDetail.es.js +1 -1
- package/dist/recurringtransactions/components/RecurrenceRow.es.js +6 -6
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js +4 -4
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringRow.es.js +6 -6
- package/dist/settings/components/transactionrules/components/RuleListItem.es.js +4 -4
- package/dist/transactions/components/shared/transactiondetails/TransactionDetailsView.es.js +5 -5
- package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/DeleteAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/DeleteLogoAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/ExcludeAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/MemoAction.es.js +11 -11
- package/dist/transactions/components/shared/transactiondetails/actions/SplitAction.es.js +9 -9
- package/dist/transactions/components/shared/transactiondetails/actions/TagsAction.es.js +9 -9
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +4 -4
- package/dist/transactions/components/tagmanager/TagRow.es.js +4 -4
- package/dist/trends/components/CategoryDetails.es.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [9.4.26] - 09-16-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Account filter accessibility (MEW-3452)
|
|
4
|
+
|
|
5
|
+
## [9.4.25] - 09-16-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - Dismissible tip section in the `TransactionHistoryBlock` drawer's `bill_amount_not_standard` (`TRANSACTION`) drilldown variant: a shared `TipSection` component nudging the user to reach out to the merchant, dismissible via a new `onDismiss` handler and `tip_section_message`/`tip_section_title` copy keys (`insights_feed.general`) (WEC-1804)
|
|
8
|
+
- **ADDED** - `InsightsPayload.title` (`string`), per backend confirmation that the beat's display title is sent on the payload rather than read off the beat itself (WEC-1804)
|
|
9
|
+
- **CHANGED** - Renamed `InsightsPayload.subtitle` to `InsightsPayload.sub_title` to match what the backend actually sends, updating `BaseLayout`, `TransactionHistoryBlock`, and all related test/story/mock fixtures (WEC-1804)
|
|
10
|
+
- **CHANGED** - `BaseLayout` and `TransactionHistoryBlock`'s `bill_amount_not_standard` (`TRANSACTION`) drilldown header now read the beat's title/subtitle from `insights_payload.title`/`insights_payload.sub_title` instead of `beat.title`/`beat.html_title`; `DrillDownHeaderContext` (`TransactionHistoryBlock/layout.tsx`) updated from `{ htmlTitle, primaryTransaction }` to `{ title, subHeader }` to match (WEC-1804)
|
|
11
|
+
- **CHANGED** - `SubHeader`'s logo resolution now checks `merchant_guid` before `institution_guid` (previously institution took priority over merchant), with a TODO to have the backend send only the one relevant guid per beat instead of relying on check order (WEC-1804)
|
|
12
|
+
- **FIXED** - `TransactionHistoryBlock` and `BarchartBlock` now fall back to the generic "Monthly Amount"/"Trend" copy for the bar chart's legend labels when the backend doesn't send `legends` on `instance_slot_data`. `TransactionHistoryBlock`'s first attempt at this fallback was dead code (`array.map() ?? fallback` — `.map()` never returns `null`/`undefined`, so the `??` could never trigger); fixed to check `legends?.length` before mapping, and added regression tests for the empty-legends case in both blocks (WEC-1804)
|
|
13
|
+
- **FIXED** - `BarchartBlock` now waits on `GlobalUiStore.isCopyLoaded` (rendering `Loader` until then) before reading copy for its legend fallback, matching `TransactionHistoryBlock`'s pattern — `BaseLayout` renders block components without waiting for copy to load, so `BarchartBlock` could previously mount and crash (`Cannot read properties of undefined (reading 'general')`) before `GlobalCopyStore` finished loading (WEC-1804)
|
|
14
|
+
|
|
1
15
|
## [9.4.24] - 09-16-2026
|
|
2
16
|
|
|
3
17
|
- **ADDED** - insights-v2 beat CTA post message (ported from Pulse): when a beat CTA has no drilldown drawer `block`, clicking it now notifies the host via a `beat/cta` post message (payload `action`, `beat_guid`, `beat_template`, `action_string?`, `user_guid`) or, on a native mobile webview, navigates to a `scheme://pulse/<event>?metadata=...` URL. New helpers in `common/utils/PostMessage.ts` (`getBaseCtaPostMessage`, `sendBeatPostMessage`, `setWebviewURL`, `dispatchBeatCta`, `BEAT_CTA_EVENT`, `BEAT_OPERATION_1/2/3`); `BaseLayout` CTA buttons route through a `handleCtaClick` helper that opens the drawer for CTAs with a real block and otherwise dispatches the post message. Scoped to the Save an extra $100 beat's "Make a Transfer" CTA (WEC-1805)
|
|
@@ -11,22 +11,22 @@ import { Fragment as d, jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
|
11
11
|
import { useTheme as j } from "@mui/material/styles";
|
|
12
12
|
import c from "@mui/material/Box";
|
|
13
13
|
import T from "@mui/material/ListItem";
|
|
14
|
-
import $ from "@mui/material/
|
|
15
|
-
import M from "@mui/material/
|
|
16
|
-
import k from "@mui/material/
|
|
14
|
+
import $ from "@mui/material/ListItemAvatar";
|
|
15
|
+
import M from "@mui/material/ListItemButton";
|
|
16
|
+
import k from "@mui/material/ListItemText";
|
|
17
17
|
import D from "@mui/material/Badge";
|
|
18
18
|
var E = ({ account: t, onRowClick: n, listItemProps: s, shouldShowConnectionStatus: p = !1 }) => {
|
|
19
19
|
const u = j(), f = _(t), { config: h } = v(), { accounts: o } = I(), { firstSubtitle: b, firstValue: g, secondSubtitle: y, secondValue: x } = L(t, o, h.display_available_balance_in_accounts);
|
|
20
20
|
let a;
|
|
21
21
|
(t.connectionStatus === l.Error || t.connectionStatus === l.RequiresMfa) && (a = /* @__PURE__ */ e(S, { size: 16 }));
|
|
22
|
-
const m = /* @__PURE__ */ r(d, { children: [/* @__PURE__ */ e(
|
|
22
|
+
const m = /* @__PURE__ */ r(d, { children: [/* @__PURE__ */ e($, { children: /* @__PURE__ */ e(D, {
|
|
23
23
|
badgeContent: p ? a : void 0,
|
|
24
24
|
sx: { "& .MuiBadge-badge": { right: -1 } },
|
|
25
25
|
children: /* @__PURE__ */ e(B, {
|
|
26
26
|
alt: "MX",
|
|
27
27
|
institutionGuid: t.institution_guid || ""
|
|
28
28
|
})
|
|
29
|
-
}) }), /* @__PURE__ */ e(
|
|
29
|
+
}) }), /* @__PURE__ */ e(k, {
|
|
30
30
|
disableTypography: !0,
|
|
31
31
|
primary: /* @__PURE__ */ r(i, {
|
|
32
32
|
bold: !0,
|
|
@@ -76,7 +76,7 @@ var E = ({ account: t, onRowClick: n, listItemProps: s, shouldShowConnectionStat
|
|
|
76
76
|
color: t.is_closed ? "grey.700" : "",
|
|
77
77
|
...s?.sx
|
|
78
78
|
},
|
|
79
|
-
children: n ? /* @__PURE__ */ e(
|
|
79
|
+
children: n ? /* @__PURE__ */ e(M, {
|
|
80
80
|
alignItems: "flex-start",
|
|
81
81
|
onClick: n,
|
|
82
82
|
sx: { px: 24 },
|
|
@@ -10,9 +10,9 @@ import { Fragment as w, jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
|
10
10
|
import y from "@mui/material/Divider";
|
|
11
11
|
import S from "@mui/material/List";
|
|
12
12
|
import $ from "@mui/material/ListItem";
|
|
13
|
-
import j from "@mui/material/
|
|
14
|
-
import G from "@mui/material/
|
|
15
|
-
import N from "@mui/material/
|
|
13
|
+
import j from "@mui/material/ListItemAvatar";
|
|
14
|
+
import G from "@mui/material/ListItemButton";
|
|
15
|
+
import N from "@mui/material/ListItemText";
|
|
16
16
|
import M from "@mui/material/ListSubheader";
|
|
17
17
|
var P = ({ onClick: i, shouldShowBalance: c = !0, loadAccounts: m }) => {
|
|
18
18
|
const { config: p } = L(), { accounts: l } = A(), { selectedAccounts: n } = C(), h = a.useCallback((e) => {
|
|
@@ -50,11 +50,11 @@ var P = ({ onClick: i, shouldShowBalance: c = !0, loadAccounts: m }) => {
|
|
|
50
50
|
sx: { bgcolor: "background.paper" },
|
|
51
51
|
children: [u.map((r, o) => {
|
|
52
52
|
const { firstValue: x } = T(r, l, p.display_available_balance_in_accounts), v = F(r, { allowNickname: p?.show_account_nicknames_in_master }), d = /* @__PURE__ */ s(w, { children: [
|
|
53
|
-
/* @__PURE__ */ t(
|
|
53
|
+
/* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(D, {
|
|
54
54
|
alt: "MX",
|
|
55
55
|
institutionGuid: r.institution_guid ?? ""
|
|
56
56
|
}) }),
|
|
57
|
-
/* @__PURE__ */ t(
|
|
57
|
+
/* @__PURE__ */ t(N, {
|
|
58
58
|
primary: `${v}${r.account_number ? ` *${r.account_number}` : ""}`,
|
|
59
59
|
slotProps: { primary: {
|
|
60
60
|
noWrap: !0,
|
|
@@ -70,7 +70,7 @@ var P = ({ onClick: i, shouldShowBalance: c = !0, loadAccounts: m }) => {
|
|
|
70
70
|
] });
|
|
71
71
|
return /* @__PURE__ */ s(a.Fragment, { children: [/* @__PURE__ */ t($, {
|
|
72
72
|
sx: { px: i ? 0 : 24 },
|
|
73
|
-
children: i ? /* @__PURE__ */ t(
|
|
73
|
+
children: i ? /* @__PURE__ */ t(G, {
|
|
74
74
|
onClick: () => h(r),
|
|
75
75
|
children: d
|
|
76
76
|
}) : d
|
|
@@ -12,9 +12,9 @@ import { CheckCircle as I, Error as L, Language as z } from "@mxenabled/mx-icons
|
|
|
12
12
|
import { Fragment as a, jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
13
13
|
import { useTheme as R } from "@mui/material/styles";
|
|
14
14
|
import b from "@mui/material/ListItem";
|
|
15
|
+
import c from "@mui/material/ListItemAvatar";
|
|
15
16
|
import f from "@mui/material/ListItemButton";
|
|
16
|
-
import
|
|
17
|
-
import s from "@mui/material/ListItemAvatar";
|
|
17
|
+
import s from "@mui/material/ListItemText";
|
|
18
18
|
import A from "@mui/material/ListSubheader";
|
|
19
19
|
var m = {
|
|
20
20
|
color: "background.default",
|
|
@@ -74,21 +74,21 @@ var m = {
|
|
|
74
74
|
direction: "row",
|
|
75
75
|
px: 24,
|
|
76
76
|
py: 12,
|
|
77
|
-
children: [/* @__PURE__ */ o(
|
|
77
|
+
children: [/* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(i, {
|
|
78
78
|
backingSx: {
|
|
79
79
|
backgroundColor: r.color,
|
|
80
80
|
borderRadius: 1
|
|
81
81
|
},
|
|
82
82
|
size: 32,
|
|
83
83
|
children: r.icon
|
|
84
|
-
}) }), /* @__PURE__ */ o(
|
|
84
|
+
}) }), /* @__PURE__ */ o(s, {
|
|
85
85
|
primary: r.mainMessage,
|
|
86
86
|
secondary: r.secondaryMessage
|
|
87
87
|
})]
|
|
88
88
|
}) : /* @__PURE__ */ n(f, {
|
|
89
89
|
onClick: () => d(!0),
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */ o(
|
|
91
|
+
/* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(i, {
|
|
92
92
|
backingSx: {
|
|
93
93
|
backgroundColor: r.color,
|
|
94
94
|
borderRadius: 1
|
|
@@ -96,7 +96,7 @@ var m = {
|
|
|
96
96
|
size: 32,
|
|
97
97
|
children: r.icon
|
|
98
98
|
}) }),
|
|
99
|
-
/* @__PURE__ */ o(
|
|
99
|
+
/* @__PURE__ */ o(s, {
|
|
100
100
|
primary: r.mainMessage,
|
|
101
101
|
secondary: r.secondaryMessage && /* @__PURE__ */ n(a, { children: [
|
|
102
102
|
r.secondaryMessage,
|
|
@@ -124,7 +124,7 @@ var m = {
|
|
|
124
124
|
href: e.institution_url,
|
|
125
125
|
target: "_blank",
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */ o(
|
|
127
|
+
/* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(i, {
|
|
128
128
|
backingSx: {
|
|
129
129
|
backgroundColor: u === "light" ? "grey.300" : "grey.700",
|
|
130
130
|
borderRadius: 1
|
|
@@ -135,7 +135,7 @@ var m = {
|
|
|
135
135
|
color: u === "light" ? "grey.900" : "common.white"
|
|
136
136
|
} })
|
|
137
137
|
}) }),
|
|
138
|
-
/* @__PURE__ */ o(
|
|
138
|
+
/* @__PURE__ */ o(s, {
|
|
139
139
|
primary: e.name,
|
|
140
140
|
secondary: e.institution_url
|
|
141
141
|
}),
|
|
@@ -7,18 +7,18 @@ import { CategoryIcon as f } from "@mxenabled/mxui";
|
|
|
7
7
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
8
8
|
import g from "@mui/material/Divider";
|
|
9
9
|
import b from "@mui/material/ListItem";
|
|
10
|
-
import v from "@mui/material/
|
|
11
|
-
import y from "@mui/material/
|
|
12
|
-
import x from "@mui/material/
|
|
10
|
+
import v from "@mui/material/ListItemAvatar";
|
|
11
|
+
import y from "@mui/material/ListItemButton";
|
|
12
|
+
import x from "@mui/material/ListItemText";
|
|
13
13
|
var S = l(({ category: r }) => {
|
|
14
14
|
const { budgets: o } = p(), { budgets: e } = c(), a = u.useMemo(() => {
|
|
15
15
|
const m = e.find((d) => d.category_guid === r.guid);
|
|
16
16
|
return `${i(r.totalAverageAmount, "0,0")} - ${m ? s(o.recalculate_previous_budget, i(m.amount, "0,0")) : o.recalculate_new_budget}`;
|
|
17
17
|
}, [o, e]);
|
|
18
|
-
return /* @__PURE__ */ n(u.Fragment, { children: [/* @__PURE__ */ t(b, { children: /* @__PURE__ */ n(
|
|
18
|
+
return /* @__PURE__ */ n(u.Fragment, { children: [/* @__PURE__ */ t(b, { children: /* @__PURE__ */ n(y, { children: [/* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(f, {
|
|
19
19
|
categoryGuid: r.guid,
|
|
20
20
|
variant: "filled"
|
|
21
|
-
}) }), /* @__PURE__ */ t(
|
|
21
|
+
}) }), /* @__PURE__ */ t(x, {
|
|
22
22
|
primary: r.name,
|
|
23
23
|
secondary: a
|
|
24
24
|
})] }) }), /* @__PURE__ */ t(g, {})] }, r.guid);
|
|
@@ -7,17 +7,17 @@ import { observer as A } from "mobx-react-lite";
|
|
|
7
7
|
import { CategoryIcon as b, Icon as I } from "@mxenabled/mxui";
|
|
8
8
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
9
9
|
import h from "@mui/material/ListItem";
|
|
10
|
-
import y from "@mui/material/
|
|
11
|
-
import C from "@mui/material/
|
|
12
|
-
import g from "@mui/material/
|
|
10
|
+
import y from "@mui/material/ListItemAvatar";
|
|
11
|
+
import C from "@mui/material/ListItemButton";
|
|
12
|
+
import g from "@mui/material/ListItemText";
|
|
13
13
|
import x from "@mui/material/ListItemSecondaryAction";
|
|
14
14
|
var w = A(({ category: t, onAddBudget: a }) => {
|
|
15
15
|
const { budgets: e, common: s } = p(), [d, i] = m.useState(!1), [r, u] = m.useState(`${t.totalAmount === 0 ? "" : t.totalAmount}`);
|
|
16
|
-
return /* @__PURE__ */ n(m.Fragment, { children: [/* @__PURE__ */ o(h, { children: /* @__PURE__ */ n(
|
|
16
|
+
return /* @__PURE__ */ n(m.Fragment, { children: [/* @__PURE__ */ o(h, { children: /* @__PURE__ */ n(C, {
|
|
17
17
|
onClick: () => i(!0),
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */ o(
|
|
20
|
-
/* @__PURE__ */ o(
|
|
19
|
+
/* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(b, { categoryGuid: t.guid }) }),
|
|
20
|
+
/* @__PURE__ */ o(g, {
|
|
21
21
|
primary: t.name,
|
|
22
22
|
secondary: c(t.totalAmount, "0,0")
|
|
23
23
|
}),
|
|
@@ -9,10 +9,10 @@ import { ExpandMore as C } from "@mxenabled/mx-icons";
|
|
|
9
9
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
10
10
|
import h from "@mui/material/Divider";
|
|
11
11
|
import L from "@mui/material/ListItem";
|
|
12
|
-
import v from "@mui/material/
|
|
13
|
-
import I from "@mui/material/
|
|
14
|
-
import _ from "@mui/material/
|
|
15
|
-
import b from "@mui/material/
|
|
12
|
+
import v from "@mui/material/ListItemAvatar";
|
|
13
|
+
import I from "@mui/material/ListItemButton";
|
|
14
|
+
import _ from "@mui/material/ListItemIcon";
|
|
15
|
+
import b from "@mui/material/ListItemText";
|
|
16
16
|
var G = ({ category: r, subCategories: a }) => {
|
|
17
17
|
const { expandedGuid: i, searchValue: m, setExpandedGuid: d } = f(), { onEvent: s } = p(), l = r.guid === i, u = () => {
|
|
18
18
|
const e = r.guid !== i ? r.guid : null;
|
|
@@ -22,22 +22,22 @@ var G = ({ category: r, subCategories: a }) => {
|
|
|
22
22
|
/* @__PURE__ */ t(L, {
|
|
23
23
|
disableGutters: !0,
|
|
24
24
|
disablePadding: !0,
|
|
25
|
-
children: /* @__PURE__ */ n(
|
|
25
|
+
children: /* @__PURE__ */ n(I, {
|
|
26
26
|
"aria-controls": `subcategories-${r.guid}`,
|
|
27
27
|
"aria-expanded": r.guid === i,
|
|
28
28
|
"aria-label": r.name,
|
|
29
29
|
id: `category-${r.guid}`,
|
|
30
30
|
onClick: u,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ t(
|
|
33
|
-
/* @__PURE__ */ t(
|
|
32
|
+
/* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(x, { categoryGuid: r.guid }) }),
|
|
33
|
+
/* @__PURE__ */ t(b, {
|
|
34
34
|
primary: r.name,
|
|
35
35
|
slotProps: { primary: {
|
|
36
36
|
fontWeight: "normal",
|
|
37
37
|
variant: "body1"
|
|
38
38
|
} }
|
|
39
39
|
}),
|
|
40
|
-
/* @__PURE__ */ t(
|
|
40
|
+
/* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(C, { sx: {
|
|
41
41
|
transition: "transform 0.3s ease-in-out",
|
|
42
42
|
transform: l || m ? "rotate(180deg)" : "rotate(0deg)"
|
|
43
43
|
} }) })
|
|
@@ -2,20 +2,20 @@ import "react";
|
|
|
2
2
|
import { Icon as o } from "@mxenabled/mxui";
|
|
3
3
|
import { Fragment as l, jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
4
4
|
import i from "@mui/material/ListItem";
|
|
5
|
-
import c from "@mui/material/
|
|
6
|
-
import f from "@mui/material/
|
|
7
|
-
import p from "@mui/material/
|
|
8
|
-
import h from "@mui/material/
|
|
9
|
-
import u from "@mui/material/
|
|
5
|
+
import c from "@mui/material/Avatar";
|
|
6
|
+
import f from "@mui/material/ListItemAvatar";
|
|
7
|
+
import p from "@mui/material/ListItemButton";
|
|
8
|
+
import h from "@mui/material/ListItemIcon";
|
|
9
|
+
import u from "@mui/material/ListItemText";
|
|
10
10
|
var A = ({ iconName: m, label: n, onClick: t, showChevron: s = !0, value: d }) => {
|
|
11
|
-
const e = /* @__PURE__ */ a(l, { children: [/* @__PURE__ */ r(
|
|
11
|
+
const e = /* @__PURE__ */ a(l, { children: [/* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(c, {
|
|
12
12
|
sx: { bgcolor: "neutral.light" },
|
|
13
13
|
variant: "rounded",
|
|
14
14
|
children: /* @__PURE__ */ r(o, {
|
|
15
15
|
name: m,
|
|
16
16
|
sx: { color: "text.primary" }
|
|
17
17
|
})
|
|
18
|
-
}) }), /* @__PURE__ */ r(
|
|
18
|
+
}) }), /* @__PURE__ */ r(u, {
|
|
19
19
|
primary: n,
|
|
20
20
|
secondary: d,
|
|
21
21
|
slotProps: {
|
|
@@ -33,9 +33,9 @@ var A = ({ iconName: m, label: n, onClick: t, showChevron: s = !0, value: d }) =
|
|
|
33
33
|
return t ? /* @__PURE__ */ r(i, {
|
|
34
34
|
disableGutters: !0,
|
|
35
35
|
disablePadding: !0,
|
|
36
|
-
children: /* @__PURE__ */ a(
|
|
36
|
+
children: /* @__PURE__ */ a(p, {
|
|
37
37
|
onClick: t,
|
|
38
|
-
children: [e, s && /* @__PURE__ */ r(
|
|
38
|
+
children: [e, s && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(o, {
|
|
39
39
|
name: "chevron_right",
|
|
40
40
|
size: 24
|
|
41
41
|
}) })]
|
|
@@ -1,97 +1,122 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
53
|
-
children: /* @__PURE__ */ t(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
transformOrigin: {
|
|
64
|
-
vertical: "top",
|
|
65
|
-
horizontal: "left"
|
|
66
|
-
},
|
|
67
|
-
children: /* @__PURE__ */ l(u, { children: [
|
|
68
|
-
/* @__PURE__ */ t(k, { allowedAccountTypes: d }),
|
|
69
|
-
/* @__PURE__ */ t(j, {}),
|
|
70
|
-
/* @__PURE__ */ l(u, {
|
|
71
|
-
direction: "row",
|
|
72
|
-
justifyContent: "space-between",
|
|
73
|
-
spacing: 16,
|
|
74
|
-
sx: { p: 16 },
|
|
75
|
-
children: [/* @__PURE__ */ t(n, {
|
|
76
|
-
fullWidth: !0,
|
|
77
|
-
onClick: s,
|
|
78
|
-
variant: "text",
|
|
79
|
-
children: r.cancel_button
|
|
80
|
-
}), /* @__PURE__ */ t(n, {
|
|
81
|
-
"aria-label": e.filter_button_generic_aria,
|
|
82
|
-
color: "primary",
|
|
83
|
-
fullWidth: !0,
|
|
84
|
-
onClick: y,
|
|
85
|
-
variant: "contained",
|
|
86
|
-
children: r.filter_button
|
|
87
|
-
})]
|
|
1
|
+
import { buildDynamicCopy as O } from "../../core/utils/Localization.es.js";
|
|
2
|
+
import { useAccountStore as j, useGlobalCopyStore as W, useGlobalUiStore as I } from "../context/hooks.es.js";
|
|
3
|
+
import { useAriaLive as y } from "../hooks/useAriaLive.es.js";
|
|
4
|
+
import { buildSelectionFilter as K, getSelectionCounts as M } from "./globalaccountfilter/selection.es.js";
|
|
5
|
+
import { GlobalAccountFilterList as P } from "./globalaccountfilter/GlobalAccountFilterList.es.js";
|
|
6
|
+
import a from "react";
|
|
7
|
+
import { observer as T } from "mobx-react-lite";
|
|
8
|
+
import A from "@mui/material/Stack";
|
|
9
|
+
import u from "@mui/material/Button";
|
|
10
|
+
import { FilterAlt as C } from "@mxenabled/mx-icons";
|
|
11
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
12
|
+
import U from "@mui/material/Box";
|
|
13
|
+
import q from "@mui/material/IconButton";
|
|
14
|
+
import H from "@mui/material/Divider";
|
|
15
|
+
import J from "@mui/material/Popover";
|
|
16
|
+
import N from "@mui/material/Tooltip";
|
|
17
|
+
var st = T(({ allowedAccountTypes: p, isDesktop: S, onAccountFilterClick: F, sx: k = {}, variant: _ = "text" }) => {
|
|
18
|
+
const { common: i } = W(), { accountFilterMap: m, resetAccountFilterMap: w } = I(), { detailedAccounts: d, updateAccountFilter: B } = j(), { announce: L, ariaLive: D } = y(), { announce: f, ariaLive: E } = y(), [h, c] = a.useState(null), r = a.useRef(null), l = a.useRef(0), n = i.account_filter, b = (o) => {
|
|
19
|
+
l.current += 1, r.current = null, w(), c(o.currentTarget), F?.();
|
|
20
|
+
}, g = () => {
|
|
21
|
+
l.current += 1, c(null);
|
|
22
|
+
}, v = async () => {
|
|
23
|
+
const { selected: o, total: z } = M(K(m, d, p)), G = l.current;
|
|
24
|
+
await B(m), G === l.current && (r.current = O(n.applied_announcement, String(o), String(z)), c(null));
|
|
25
|
+
}, R = (o) => {
|
|
26
|
+
o.key === "Enter" && o.target === o.currentTarget && v();
|
|
27
|
+
}, e = !!h, x = d.length === 0;
|
|
28
|
+
return a.useEffect(() => {
|
|
29
|
+
e || !r.current || (f(r.current), r.current = null);
|
|
30
|
+
}, [e, f]), /* @__PURE__ */ s(U, {
|
|
31
|
+
sx: { ...k },
|
|
32
|
+
children: [
|
|
33
|
+
E,
|
|
34
|
+
S ? /* @__PURE__ */ t(u, {
|
|
35
|
+
"aria-controls": e ? "filter_accounts" : void 0,
|
|
36
|
+
"aria-expanded": e,
|
|
37
|
+
"aria-haspopup": "dialog",
|
|
38
|
+
"aria-label": n.title,
|
|
39
|
+
disabled: x,
|
|
40
|
+
onClick: b,
|
|
41
|
+
startIcon: /* @__PURE__ */ t(C, { size: 24 }),
|
|
42
|
+
sx: {
|
|
43
|
+
p: 8,
|
|
44
|
+
whiteSpace: "nowrap",
|
|
45
|
+
minWidth: "max-content"
|
|
46
|
+
},
|
|
47
|
+
variant: _,
|
|
48
|
+
children: i.filter_button
|
|
49
|
+
}) : /* @__PURE__ */ t(N, {
|
|
50
|
+
id: "filter-accounts",
|
|
51
|
+
placement: "bottom",
|
|
52
|
+
title: n.title,
|
|
53
|
+
children: /* @__PURE__ */ t(q, {
|
|
54
|
+
"aria-controls": e ? "filter_accounts" : void 0,
|
|
55
|
+
"aria-expanded": e,
|
|
56
|
+
"aria-haspopup": "dialog",
|
|
57
|
+
"aria-label": n.title,
|
|
58
|
+
color: "primary",
|
|
59
|
+
disabled: x,
|
|
60
|
+
onClick: b,
|
|
61
|
+
sx: { p: 8 },
|
|
62
|
+
children: /* @__PURE__ */ t(C, { size: 24 })
|
|
88
63
|
})
|
|
89
|
-
|
|
90
|
-
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ t(J, {
|
|
66
|
+
anchorEl: h,
|
|
67
|
+
anchorOrigin: {
|
|
68
|
+
vertical: "bottom",
|
|
69
|
+
horizontal: "left"
|
|
70
|
+
},
|
|
71
|
+
onClose: g,
|
|
72
|
+
open: e,
|
|
73
|
+
slotProps: { paper: {
|
|
74
|
+
"aria-label": n.title,
|
|
75
|
+
"aria-modal": !0,
|
|
76
|
+
onKeyDown: R,
|
|
77
|
+
role: "dialog"
|
|
78
|
+
} },
|
|
79
|
+
transformOrigin: {
|
|
80
|
+
vertical: "top",
|
|
81
|
+
horizontal: "left"
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ s(A, { children: [
|
|
84
|
+
D,
|
|
85
|
+
/* @__PURE__ */ t(P, {
|
|
86
|
+
allowedAccountTypes: p,
|
|
87
|
+
announce: L
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ t(H, {}),
|
|
90
|
+
/* @__PURE__ */ s(A, {
|
|
91
|
+
direction: "row",
|
|
92
|
+
justifyContent: "space-between",
|
|
93
|
+
spacing: 16,
|
|
94
|
+
sx: {
|
|
95
|
+
bgcolor: "background.paper",
|
|
96
|
+
bottom: 0,
|
|
97
|
+
p: 16,
|
|
98
|
+
position: "sticky"
|
|
99
|
+
},
|
|
100
|
+
children: [/* @__PURE__ */ t(u, {
|
|
101
|
+
fullWidth: !0,
|
|
102
|
+
onClick: g,
|
|
103
|
+
variant: "text",
|
|
104
|
+
children: i.cancel_button
|
|
105
|
+
}), /* @__PURE__ */ t(u, {
|
|
106
|
+
color: "primary",
|
|
107
|
+
fullWidth: !0,
|
|
108
|
+
onClick: v,
|
|
109
|
+
variant: "contained",
|
|
110
|
+
children: i.filter_button
|
|
111
|
+
})]
|
|
112
|
+
})
|
|
113
|
+
] })
|
|
114
|
+
})
|
|
115
|
+
]
|
|
91
116
|
});
|
|
92
117
|
});
|
|
93
118
|
export {
|
|
94
|
-
|
|
119
|
+
st as GlobalAccountFilter
|
|
95
120
|
};
|
|
96
121
|
|
|
97
122
|
//# sourceMappingURL=GlobalAccountFilter.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalAccountFilter.es.js","names":[],"sources":["../../../src/common/components/GlobalAccountFilter.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Popover from '@mui/material/Popover'\nimport Stack from '@mui/material/Stack'\nimport Tooltip from '@mui/material/Tooltip'\nimport { SxProps } from '@mui/material/styles'\n\nimport { FilterAlt } from '@mxenabled/mx-icons'\n\nimport { useAccountStore, useGlobalCopyStore, useGlobalUiStore } from '../context'\nimport { AccountType } from '../../core'\n\nimport { GlobalAccountFilterList } from './globalaccountfilter/GlobalAccountFilterList'\n\nexport interface GlobalAccountFilterProps {\n allowedAccountTypes?: AccountType[] | undefined\n isDesktop?: boolean\n onAccountFilterClick?: () => void\n sx?: SxProps\n variant?: 'outlined' | 'text'\n}\n\nexport const GlobalAccountFilter = observer(\n ({\n allowedAccountTypes,\n isDesktop,\n onAccountFilterClick,\n sx = {},\n variant = 'text',\n }: GlobalAccountFilterProps) => {\n const { common: commonCopy } = useGlobalCopyStore()\n const { accountFilterMap, resetAccountFilterMap } = useGlobalUiStore()\n\n const { detailedAccounts, updateAccountFilter } = useAccountStore()\n\n const [filterButtonEl, setFilterButtonEl] = React.useState<HTMLButtonElement | null>(null)\n\n const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\n resetAccountFilterMap()\n setFilterButtonEl(event.currentTarget)\n onAccountFilterClick?.()\n }\n\n const handleCancel = () => {\n setFilterButtonEl(null)\n }\n\n const handleFilter = async () => {\n await updateAccountFilter(accountFilterMap)\n setFilterButtonEl(null)\n }\n\n const copy = commonCopy.account_filter\n const isFilterOpen = Boolean(filterButtonEl)\n const filterDisabled = detailedAccounts.length === 0\n\n return (\n <Box sx={{ ...sx }}>\n {isDesktop ? (\n <Button\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup={true}\n aria-label={copy.title}\n disabled={filterDisabled}\n onClick={handleOpen}\n startIcon={<FilterAlt size={24} />}\n sx={{ p: 8, whiteSpace: 'nowrap', minWidth: 'max-content' }}\n variant={variant}\n >\n {commonCopy.filter_button}\n </Button>\n ) : (\n <Tooltip id=\"filter-accounts\" placement=\"bottom\" title={copy.title}>\n <IconButton\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-describedby=\"filter-accounts\"\n aria-expanded={isFilterOpen}\n aria-haspopup={true}\n aria-label={copy.title}\n color=\"primary\"\n disabled={filterDisabled}\n onClick={handleOpen}\n sx={{ p: 8 }}\n >\n <FilterAlt size={24} />\n </IconButton>\n </Tooltip>\n )}\n\n <Popover\n anchorEl={filterButtonEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n onClose={handleCancel}\n open={isFilterOpen}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n <Stack>\n <GlobalAccountFilterList allowedAccountTypes={allowedAccountTypes} />\n <Divider />\n <Stack direction=\"row\" justifyContent=\"space-between\" spacing={16} sx={{ p: 16 }}>\n <Button fullWidth={true} onClick={handleCancel} variant=\"text\">\n {commonCopy.cancel_button}\n </Button>\n <Button\n aria-label={copy.filter_button_generic_aria}\n color=\"primary\"\n fullWidth={true}\n onClick={handleFilter}\n variant=\"contained\"\n >\n {commonCopy.filter_button}\n </Button>\n </Stack>\n </Stack>\n </Popover>\n </Box>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;AA2BA,IAAa,IAAsB,EAAA,CAChC,EACC,qBAAA,GACA,WAAA,GACA,sBAAA,GACA,IAAA,IAAK,CAAC,GACN,SAAA,IAAU,OAAA,MACoB;AAC9B,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,kBAAA,GAAkB,uBAAA,EAAA,IAA0B,EAAiB,GAE/D,EAAE,kBAAA,GAAkB,qBAAA,EAAA,IAAwB,EAAgB,GAE5D,CAAC,GAAgB,CAAA,IAAqB,EAAM,SAAmC,IAAI,GAEnF,IAAA,CAAc,MAA+C;AAC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,MAAO;AAAA,MACvD,SAAS;AAAA,MACT,MAAM;AAAA,MACN,iBAAiB;AAAA,QAAE,UAAU;AAAA,QAAO,YAAY;AAAA,MAAO;AAAA,MAEvD,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAA;AAAA,QACE,gBAAA,EAAC,GAAD,EAA8C,qBAAA,EAAsB,CAAA;AAAA,QACpE,gBAAA,EAAC,GAAD,CAAU,CAAA;AAAA,QACV,gBAAA,EAAC,GAAD;AAAA,UAAO,WAAU;AAAA,UAAM,gBAAe;AAAA,UAAgB,SAAS;AAAA,UAAI,IAAI,EAAE,GAAG,GAAG;AAAA,UAA/E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,YAAQ,WAAW;AAAA,YAAM,SAAS;AAAA,YAAc,SAAQ;AAAA,YACrD,UAAA,EAAW;AAAA,UACN,CAAA,GACR,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY,EAAK;AAAA,YACjB,OAAM;AAAA,YACN,WAAW;AAAA,YACX,SAAS;AAAA,YACT,SAAQ;AAAA,YAEP,UAAA,EAAW;AAAA,UACN,CAAA,CACH;AAAA;MACF,EAAA,CAAA;AAAA,IACA,CAAA,CACN;AAAA;AAET,CACF"}
|
|
1
|
+
{"version":3,"file":"GlobalAccountFilter.es.js","names":[],"sources":["../../../src/common/components/GlobalAccountFilter.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Popover from '@mui/material/Popover'\nimport Stack from '@mui/material/Stack'\nimport Tooltip from '@mui/material/Tooltip'\nimport { SxProps } from '@mui/material/styles'\n\nimport { FilterAlt } from '@mxenabled/mx-icons'\n\nimport { useAccountStore, useGlobalCopyStore, useGlobalUiStore } from '../context'\nimport { AccountType } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport { useAriaLive } from '../hooks/useAriaLive'\n\nimport { GlobalAccountFilterList } from './globalaccountfilter/GlobalAccountFilterList'\nimport { buildSelectionFilter, getSelectionCounts } from './globalaccountfilter/selection'\n\nexport interface GlobalAccountFilterProps {\n allowedAccountTypes?: AccountType[] | undefined\n isDesktop?: boolean\n onAccountFilterClick?: () => void\n sx?: SxProps\n variant?: 'outlined' | 'text'\n}\n\nexport const GlobalAccountFilter = observer(\n ({\n allowedAccountTypes,\n isDesktop,\n onAccountFilterClick,\n sx = {},\n variant = 'text',\n }: GlobalAccountFilterProps) => {\n const { common: commonCopy } = useGlobalCopyStore()\n const { accountFilterMap, resetAccountFilterMap } = useGlobalUiStore()\n\n const { detailedAccounts, updateAccountFilter } = useAccountStore()\n\n // Two regions, because MUI's ModalManager sets aria-hidden on every body\n // child outside the popover while it is open (and aria-modal tells AT to\n // ignore them anyway). Selection changes happen while the dialog is open, so\n // that region must live INSIDE it; the applied message is spoken after the\n // dialog is gone, so its region must live outside to survive the unmount.\n const { announce: announceSelection, ariaLive: selectionAriaLive } = useAriaLive()\n const { announce: announceApplied, ariaLive: appliedAriaLive } = useAriaLive()\n\n const [filterButtonEl, setFilterButtonEl] = React.useState<HTMLButtonElement | null>(null)\n // Set once the update resolves, consumed by the close effect below. It cannot\n // be announced from handleFilter directly: aria-hidden is still on the rest of\n // the document at that point, so the message would go into a hidden region.\n const pendingAppliedRef = React.useRef<string | null>(null)\n // Identifies one open..close cycle of the dialog. `handleFilter` captures it\n // before awaiting and bails if it changed, so a slow request cannot reach\n // back into a session the user has already left.\n const generationRef = React.useRef(0)\n\n const copy = commonCopy.account_filter\n\n const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\n generationRef.current += 1\n // Not subsumed by the generation guard. handleOpen and handleCancel both\n // bump the generation, so a single interrupted apply bails before it writes.\n // What still reaches this line is a SECOND apply started while the first was\n // in flight -- applying does not bump, so both continuations pass the guard.\n // The first closes the dialog and the effect consumes its message; the second\n // then writes onto an already-null anchor, so setFilterButtonEl(null) is a\n // no-op, React bails out of the render, and the effect never runs to consume\n // it. Clearing on the way back in stops that leftover surfacing later.\n //\n // Pinned by 'discards a leftover message from a second apply on the next\n // open' -- delete this line and that test fails. An in-flight guard on apply\n // (MEW-4138) would remove the reachable case and retire both.\n pendingAppliedRef.current = null\n resetAccountFilterMap()\n setFilterButtonEl(event.currentTarget)\n onAccountFilterClick?.()\n }\n\n const handleCancel = () => {\n // Ends the session too, so a request abandoned here cannot write its message\n // even if it resolves before the user reopens.\n generationRef.current += 1\n setFilterButtonEl(null)\n }\n\n const handleFilter = async () => {\n const { selected, total } = getSelectionCounts(\n buildSelectionFilter(accountFilterMap, detailedAccounts, allowedAccountTypes),\n )\n\n const generation = generationRef.current\n\n await updateAccountFilter(accountFilterMap)\n\n // The dialog moved on while this was in flight -- the user cancelled, or\n // cancelled and reopened. Announcing now would speak over a session that did\n // not ask for it, and closing would shut a dialog the user just opened.\n // NOTE: the update itself already committed; cancelling does not roll it\n // back. Only the announcement and the close are suppressed here.\n if (generation !== generationRef.current) return\n\n pendingAppliedRef.current = buildDynamicCopy(\n copy.applied_announcement,\n String(selected),\n String(total),\n ) as string\n setFilterButtonEl(null)\n }\n\n // Bound to the Paper, not an inner element: FocusTrap focuses the Paper on\n // open (getFocusTarget finds no `data-mui-focusable` marker and falls back to\n // the root), and keydown there bubbles UP -- a handler on a descendant would\n // never see the first keypress.\n //\n // Only fires when the Paper ITSELF holds focus. Anything focused inside it\n // owns its own Enter behaviour: buttons activate, and a checkbox must not\n // submit -- native checkboxes ignore Enter, so without this the keypress\n // bubbled up here and closed the dialog out from under someone who was just\n // moving through the list. A whitelist rather than a `closest()` exclusion\n // list, so a control added later cannot silently inherit submit-on-Enter.\n //\n // Narrower than it looks: the Paper is tabIndex=\"-1\", so once focus moves off\n // it there is no way to Tab back. Enter-applies is a one-shot affordance,\n // available only before the first Tab. The scroll region (tabIndex={0}) is the\n // first stop after it and deliberately does nothing on Enter.\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key !== 'Enter') return\n if (event.target !== event.currentTarget) return\n\n handleFilter()\n }\n\n const isFilterOpen = Boolean(filterButtonEl)\n const filterDisabled = detailedAccounts.length === 0\n\n // Announce only once the popover is closed. `handleFilter` cannot announce\n // directly: at that point ModalManager still has aria-hidden on the rest of\n // the document, so the message would be written into a hidden region.\n //\n // Modal lifts aria-hidden in an effect when `open` flips false\n // (`closeAfterTransition` defaults false, so `useModal`'s open/close effect\n // calls handleClose immediately rather than waiting for the exit). Modal is a\n // descendant of this component and React flushes child effects first (and every\n // destroy before any create, so FocusTrap's restore lands first too), meaning\n // by the time this effect runs focus is back on the trigger and the document is\n // exposed again.\n //\n // Only ever consumes a message from the session that is closing. An apply\n // interrupted by a cancel or a reopen is stopped at the generation guard in\n // handleFilter and never writes one, in either order.\n React.useEffect(() => {\n if (isFilterOpen || !pendingAppliedRef.current) return\n\n announceApplied(pendingAppliedRef.current)\n pendingAppliedRef.current = null\n }, [isFilterOpen, announceApplied])\n\n return (\n <Box sx={{ ...sx }}>\n {appliedAriaLive}\n {isDesktop ? (\n <Button\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup=\"dialog\"\n aria-label={copy.title}\n disabled={filterDisabled}\n onClick={handleOpen}\n startIcon={<FilterAlt size={24} />}\n sx={{ p: 8, whiteSpace: 'nowrap', minWidth: 'max-content' }}\n variant={variant}\n >\n {commonCopy.filter_button}\n </Button>\n ) : (\n <Tooltip id=\"filter-accounts\" placement=\"bottom\" title={copy.title}>\n <IconButton\n aria-controls={isFilterOpen ? 'filter_accounts' : undefined}\n aria-expanded={isFilterOpen}\n aria-haspopup=\"dialog\"\n aria-label={copy.title}\n color=\"primary\"\n disabled={filterDisabled}\n onClick={handleOpen}\n sx={{ p: 8 }}\n >\n <FilterAlt size={24} />\n </IconButton>\n </Tooltip>\n )}\n\n <Popover\n anchorEl={filterButtonEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n onClose={handleCancel}\n open={isFilterOpen}\n // aria-modal is what Chrome surfaces to the Android accessibility API as a\n // modal subtree. Without it TalkBack walks past the last control and out of\n // the webview into the host app's native chrome -- aria-hidden (applied to\n // background siblings by MUI's Modal) only bounds the DOM, not the webview.\n slotProps={{\n paper: {\n 'aria-label': copy.title,\n 'aria-modal': true,\n onKeyDown: handleKeyDown,\n role: 'dialog',\n },\n }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n <Stack>\n {selectionAriaLive}\n <GlobalAccountFilterList\n allowedAccountTypes={allowedAccountTypes}\n announce={announceSelection}\n />\n <Divider />\n <Stack\n direction=\"row\"\n justifyContent=\"space-between\"\n spacing={16}\n sx={{ bgcolor: 'background.paper', bottom: 0, p: 16, position: 'sticky' }}\n >\n <Button fullWidth={true} onClick={handleCancel} variant=\"text\">\n {commonCopy.cancel_button}\n </Button>\n <Button color=\"primary\" fullWidth={true} onClick={handleFilter} variant=\"contained\">\n {commonCopy.filter_button}\n </Button>\n </Stack>\n </Stack>\n </Popover>\n </Box>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,IAAa,KAAsB,EAAA,CAChC,EACC,qBAAA,GACA,WAAA,GACA,sBAAA,GACA,IAAA,IAAK,CAAC,GACN,SAAA,IAAU,OAAA,MACoB;AAC9B,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,kBAAA,GAAkB,uBAAA,EAAA,IAA0B,EAAiB,GAE/D,EAAE,kBAAA,GAAkB,qBAAA,EAAA,IAAwB,EAAgB,GAO5D,EAAE,UAAU,GAAmB,UAAU,EAAA,IAAsB,EAAY,GAC3E,EAAE,UAAU,GAAiB,UAAU,EAAA,IAAoB,EAAY,GAEvE,CAAC,GAAgB,CAAA,IAAqB,EAAM,SAAmC,IAAI,GAInF,IAAoB,EAAM,OAAsB,IAAI,GAIpD,IAAgB,EAAM,OAAO,CAAC,GAE9B,IAAO,EAAW,gBAElB,IAAA,CAAc,MAA+C;AACjE,IA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CAAA,GACR,gBAAA,EAAC,GAAD;AAAA,cAAQ,OAAM;AAAA,cAAU,WAAW;AAAA,cAAM,SAAS;AAAA,cAAc,SAAQ;AAAA,cACrE,UAAA,EAAW;AAAA,YACN,CAAA,CACH;AAAA;QACF,EAAA,CAAA;AAAA,MACA,CAAA;AAAA,IACN;AAAA;AAET,CACF"}
|
|
@@ -4,8 +4,8 @@ import { Text as i } from "@mxenabled/mxui";
|
|
|
4
4
|
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
5
5
|
import h from "@mui/material/ListItem";
|
|
6
6
|
import I from "@mui/material/ListItemButton";
|
|
7
|
-
import L from "@mui/material/ListItemText";
|
|
8
7
|
import s from "@mui/material/ListItemIcon";
|
|
8
|
+
import L from "@mui/material/ListItemText";
|
|
9
9
|
var R = ({ onClick: n, leftIcon: o, rightIcon: m, title: a, subtitle: c, rightContent: l, titleBold: x = !0, rightContentBold: p = !0 }) => {
|
|
10
10
|
const d = /* @__PURE__ */ t(f.Fragment, { children: [o && /* @__PURE__ */ r(s, {
|
|
11
11
|
sx: { ml: 0 },
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AccountType } from '../../../core';
|
|
2
2
|
export interface GlobalAccountFilterListProps {
|
|
3
3
|
allowedAccountTypes: AccountType[] | undefined;
|
|
4
|
+
announce?: (message: string) => void;
|
|
4
5
|
}
|
|
5
|
-
export declare const GlobalAccountFilterList: (({ allowedAccountTypes }: GlobalAccountFilterListProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
6
|
+
export declare const GlobalAccountFilterList: (({ allowedAccountTypes, announce }: GlobalAccountFilterListProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|