@altinn/altinn-components 0.43.4 → 0.43.5
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.
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createElement as
|
|
1
|
+
import { jsxs as x, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as b } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { AccountMenu as
|
|
5
|
-
import { useRootContext as
|
|
6
|
-
import { DrawerOrDropdown as
|
|
7
|
-
import { useIsDesktop as
|
|
4
|
+
import { AccountMenu as k } from "../Account/AccountMenu.js";
|
|
5
|
+
import { useRootContext as I } from "../RootProvider/RootProvider.js";
|
|
6
|
+
import { DrawerOrDropdown as h } from "../Dropdown/DrawerOrDropdown.js";
|
|
7
|
+
import { useIsDesktop as w } from "../../hooks/useIsDesktop.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { ToolbarButton as
|
|
10
|
-
import { ToolbarFilterBase as
|
|
11
|
-
const
|
|
9
|
+
import { ToolbarButton as B } from "./ToolbarButton.js";
|
|
10
|
+
import { ToolbarFilterBase as C } from "./ToolbarFilterBase.js";
|
|
11
|
+
const q = ({
|
|
12
12
|
currentAccount: o,
|
|
13
|
-
id:
|
|
13
|
+
id: s = "toolbar-accounts",
|
|
14
14
|
onSelectAccount: t,
|
|
15
|
-
buttonTestId:
|
|
16
|
-
|
|
15
|
+
buttonTestId: d,
|
|
16
|
+
title: l = "Endre aktør",
|
|
17
|
+
...n
|
|
17
18
|
}) => {
|
|
18
|
-
const { currentId: i, toggleId:
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
const m =
|
|
21
|
-
(!m || !
|
|
19
|
+
const { currentId: i, toggleId: f, closeAll: a } = I(), T = w(), g = () => f(s), r = i === s;
|
|
20
|
+
return /* @__PURE__ */ x(C, { expanded: r, onBlurCapture: (e) => {
|
|
21
|
+
const m = e.relatedTarget;
|
|
22
|
+
(!m || !e.currentTarget.contains(m)) && a();
|
|
22
23
|
}, dataTestId: "filter-base-accounts", children: [
|
|
23
24
|
/* @__PURE__ */ p(
|
|
24
|
-
|
|
25
|
+
B,
|
|
25
26
|
{
|
|
26
27
|
type: "switch",
|
|
27
|
-
onToggle:
|
|
28
|
+
onToggle: g,
|
|
28
29
|
active: !!o,
|
|
29
|
-
dataTestId:
|
|
30
|
-
"aria-expanded":
|
|
30
|
+
dataTestId: d,
|
|
31
|
+
"aria-expanded": r,
|
|
31
32
|
children: o == null ? void 0 : o.name
|
|
32
33
|
}
|
|
33
34
|
),
|
|
34
|
-
/* @__PURE__ */ p(
|
|
35
|
-
|
|
35
|
+
/* @__PURE__ */ p(h, { open: r, size: "lg", drawerTitle: l, onClose: a, children: /* @__PURE__ */ b(
|
|
36
|
+
k,
|
|
36
37
|
{
|
|
37
|
-
...
|
|
38
|
-
keyboardEvents:
|
|
38
|
+
...n,
|
|
39
|
+
keyboardEvents: r && T,
|
|
39
40
|
key: i,
|
|
40
|
-
onSelectAccount: (
|
|
41
|
-
t == null || t(
|
|
41
|
+
onSelectAccount: (e) => {
|
|
42
|
+
t == null || t(e), a();
|
|
42
43
|
},
|
|
43
44
|
currentAccount: o
|
|
44
45
|
}
|
|
@@ -46,5 +47,5 @@ const R = ({
|
|
|
46
47
|
] });
|
|
47
48
|
};
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
q as ToolbarAccountMenu
|
|
50
51
|
};
|
|
@@ -3,5 +3,6 @@ export interface ToolbarAccountMenuProps extends AccountMenuProps {
|
|
|
3
3
|
id?: string;
|
|
4
4
|
isVirtualized?: boolean;
|
|
5
5
|
buttonTestId?: string;
|
|
6
|
+
title?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const ToolbarAccountMenu: ({ currentAccount, id, onSelectAccount, buttonTestId, ...rest }: ToolbarAccountMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const ToolbarAccountMenu: ({ currentAccount, id, onSelectAccount, buttonTestId, title, ...rest }: ToolbarAccountMenuProps) => import("react/jsx-runtime").JSX.Element;
|