@altinn/altinn-components 0.56.1 → 0.56.3
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/dist/{SearchField-BUp4_VIq.js → SearchField-CN2mo8ck.js} +42 -42
- package/dist/assets/Dropdown.css +1 -1
- package/dist/assets/LayoutSidebar.css +1 -1
- package/dist/assets/QueryLabel.css +1 -1
- package/dist/assets/SearchField.css +1 -1
- package/dist/components/Account/AccountMenu.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/Dialog/DialogActions.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +32 -32
- package/dist/components/Forms/SearchField.js +1 -1
- package/dist/components/Forms/index.js +1 -1
- package/dist/components/GlobalHeader/AccountSelector.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
- package/dist/components/GlobalMenu/LocaleSwitcher.js +1 -1
- package/dist/components/GlobalMenu_old/GlobalMenu.js +1 -1
- package/dist/components/Header/LocaleSwitcher.js +1 -1
- package/dist/components/Layout/Layout.js +28 -37
- package/dist/components/Layout/LayoutSidebar.js +8 -25
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuItems.js +1 -1
- package/dist/components/Menu/MenuListSearch.js +1 -1
- package/dist/components/Menu/VirtualizedMenuItems.js +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Searchbar/QueryLabel.js +5 -5
- package/dist/components/Toolbar/SelectDateFilter.js +1 -1
- package/dist/components/Toolbar/ToolbarFilter.js +33 -34
- package/dist/components/Toolbar/ToolbarFilterAddMenu.js +24 -22
- package/dist/components/Toolbar/ToolbarFilterMenu.js +53 -50
- package/dist/components/Toolbar/ToolbarMenu.js +19 -17
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/lib/components/Layout/LayoutSidebar.d.ts +1 -2
- package/dist/types/lib/components/Toolbar/ToolbarFilterAddMenu.d.ts +3 -1
- package/dist/types/lib/components/Toolbar/ToolbarFilterMenu.d.ts +3 -1
- package/dist/types/lib/components/Toolbar/ToolbarMenu.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,57 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { LayoutBase as
|
|
4
|
-
import { LayoutBody as
|
|
5
|
-
import { LayoutContent as
|
|
6
|
-
import { LayoutSidebar as
|
|
7
|
-
import { Footer as
|
|
8
|
-
import { GlobalHeader as
|
|
3
|
+
import { LayoutBase as h } from "./LayoutBase.js";
|
|
4
|
+
import { LayoutBody as a } from "./LayoutBody.js";
|
|
5
|
+
import { LayoutContent as y } from "./LayoutContent.js";
|
|
6
|
+
import { LayoutSidebar as d } from "./LayoutSidebar.js";
|
|
7
|
+
import { Footer as x } from "../Footer/Footer.js";
|
|
8
|
+
import { GlobalHeader as L } from "../GlobalHeader/GlobalHeader.js";
|
|
9
9
|
import "../../index-p1eeF8LQ.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import "../Button/Button.js";
|
|
12
|
-
import { M as S } from "../../SearchField-
|
|
12
|
+
import { M as S } from "../../SearchField-CN2mo8ck.js";
|
|
13
13
|
import { useRootContext as j } from "../RootProvider/RootProvider.js";
|
|
14
14
|
import { Header as B } from "../Header/Header.js";
|
|
15
15
|
import "../Snackbar/useSnackbar.js";
|
|
16
16
|
import { InboxSearch as C } from "../InboxSearch/InboxSearch.js";
|
|
17
17
|
import { SkipLink as F } from "../SkipLink/SkipLink.js";
|
|
18
|
-
const
|
|
18
|
+
const N = ({
|
|
19
19
|
color: f,
|
|
20
|
-
theme:
|
|
20
|
+
theme: l = "subtle",
|
|
21
21
|
header: t,
|
|
22
|
-
footer:
|
|
22
|
+
footer: i,
|
|
23
23
|
sidebar: o,
|
|
24
|
-
content:
|
|
25
|
-
children:
|
|
26
|
-
skipLink:
|
|
27
|
-
useGlobalHeader:
|
|
24
|
+
content: u = {},
|
|
25
|
+
children: s,
|
|
26
|
+
skipLink: c,
|
|
27
|
+
useGlobalHeader: e = !1
|
|
28
28
|
}) => {
|
|
29
|
-
const { currentId:
|
|
30
|
-
return /* @__PURE__ */ m(
|
|
31
|
-
|
|
32
|
-
t && (
|
|
33
|
-
/* @__PURE__ */ m(
|
|
34
|
-
o && /* @__PURE__ */ m(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children: [
|
|
42
|
-
o?.menu && /* @__PURE__ */ r(S, { ...o?.menu }),
|
|
43
|
-
o?.children
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
/* @__PURE__ */ m(x, { color: l?.color, id: "main-content", children: [
|
|
48
|
-
n && e && /* @__PURE__ */ r(C, { search: e }),
|
|
49
|
-
h
|
|
29
|
+
const { currentId: n } = j(), p = t && "search" in t ? t.search : void 0;
|
|
30
|
+
return /* @__PURE__ */ m(h, { color: f, theme: n === "accountFullscreen" ? "default" : l, currentId: n, children: [
|
|
31
|
+
c && /* @__PURE__ */ r(F, { ...c }),
|
|
32
|
+
t && (e ? /* @__PURE__ */ r(L, { ...t }) : /* @__PURE__ */ r(B, { ...t })),
|
|
33
|
+
/* @__PURE__ */ m(a, { currentId: n, children: [
|
|
34
|
+
o && /* @__PURE__ */ m(d, { hidden: o?.hidden, color: o?.color, footer: o?.footer, children: [
|
|
35
|
+
o?.menu && /* @__PURE__ */ r(S, { ...o?.menu }),
|
|
36
|
+
o?.children
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ m(y, { color: u?.color, id: "main-content", children: [
|
|
39
|
+
e && p && /* @__PURE__ */ r(C, { search: p }),
|
|
40
|
+
s
|
|
50
41
|
] })
|
|
51
42
|
] }),
|
|
52
|
-
|
|
43
|
+
i && /* @__PURE__ */ r(x, { ...i })
|
|
53
44
|
] });
|
|
54
45
|
};
|
|
55
46
|
export {
|
|
56
|
-
|
|
47
|
+
N as Layout
|
|
57
48
|
};
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import '../../assets/LayoutSidebar.css';const
|
|
3
|
-
sidebar:
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/LayoutSidebar.css';const c = "_sidebar_1yk7j_1", n = "_footer_1yk7j_9", a = {
|
|
3
|
+
sidebar: c,
|
|
4
4
|
footer: n
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
children: o,
|
|
10
|
-
footer: e,
|
|
11
|
-
useGlobalHeader: d = !1
|
|
12
|
-
}) => /* @__PURE__ */ i(
|
|
13
|
-
"aside",
|
|
14
|
-
{
|
|
15
|
-
className: a.sidebar,
|
|
16
|
-
"data-color": s,
|
|
17
|
-
"data-sticky": t,
|
|
18
|
-
"data-use-global-header": d,
|
|
19
|
-
"aria-hidden": r,
|
|
20
|
-
children: [
|
|
21
|
-
o,
|
|
22
|
-
e && /* @__PURE__ */ c("div", { className: a.footer, children: e })
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
);
|
|
5
|
+
}, _ = ({ color: e, hidden: r = !1, sticky: o, children: t, footer: s }) => /* @__PURE__ */ d("aside", { className: a.sidebar, "data-color": e, "data-sticky": o, "aria-hidden": r, children: [
|
|
6
|
+
t,
|
|
7
|
+
s && /* @__PURE__ */ i("div", { className: a.footer, children: s })
|
|
8
|
+
] });
|
|
26
9
|
export {
|
|
27
|
-
|
|
10
|
+
_ as LayoutSidebar
|
|
28
11
|
};
|
|
@@ -4,7 +4,7 @@ import "../../index-p1eeF8LQ.js";
|
|
|
4
4
|
import "../../hooks/useMenu.js";
|
|
5
5
|
import "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { a as b } from "../../SearchField-
|
|
7
|
+
import { a as b } from "../../SearchField-CN2mo8ck.js";
|
|
8
8
|
import "./MenuItem.js";
|
|
9
9
|
import "./MenuList.js";
|
|
10
10
|
import "./MenuListItem.js";
|
|
@@ -3,7 +3,7 @@ import "../../index-p1eeF8LQ.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "../Button/Button.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { b as s } from "../../SearchField-
|
|
6
|
+
import { b as s } from "../../SearchField-CN2mo8ck.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
8
|
export {
|
|
9
9
|
s as MenuListSearch
|
|
@@ -4,7 +4,7 @@ import "../../index-p1eeF8LQ.js";
|
|
|
4
4
|
import "../../hooks/useMenu.js";
|
|
5
5
|
import "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { V as z } from "../../SearchField-
|
|
7
|
+
import { V as z } from "../../SearchField-CN2mo8ck.js";
|
|
8
8
|
import "./MenuItem.js";
|
|
9
9
|
import "./MenuList.js";
|
|
10
10
|
import "./MenuListItem.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as t, a as o, b as n, V as u } from "../../SearchField-
|
|
1
|
+
import { M as t, a as o, b as n, V as u } from "../../SearchField-CN2mo8ck.js";
|
|
2
2
|
import { MenuItem as M } from "./MenuItem.js";
|
|
3
3
|
import { MenuList as s } from "./MenuList.js";
|
|
4
4
|
import { MenuListItem as a } from "./MenuListItem.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../assets/QueryLabel.css';const n = "
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/QueryLabel.css';const n = "_label_yf5z4_1", o = "_group_yf5z4_25", p = "_plus_yf5z4_31", m = "_item_yf5z4_35", l = {
|
|
3
3
|
label: n,
|
|
4
4
|
group: o,
|
|
5
5
|
plus: p,
|
|
6
6
|
item: m
|
|
7
|
-
}, u = ({ type:
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
7
|
+
}, u = ({ type: s = "search", label: t }) => /* @__PURE__ */ e("span", { className: l.item, "data-type": s, children: t }), i = ({ params: s = [], size: t = "sm" }) => /* @__PURE__ */ e("div", { className: l.label, "data-size": t, children: s.map((r, a) => /* @__PURE__ */ c("div", { className: l.group, children: [
|
|
8
|
+
/* @__PURE__ */ e(u, { ...r }),
|
|
9
|
+
s[a + 1] && /* @__PURE__ */ e("span", { className: l.plus, children: "+" })
|
|
10
10
|
] }, a)) });
|
|
11
11
|
export {
|
|
12
12
|
u as QueryItem,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b } from "react";
|
|
3
|
-
import { M as g } from "../../SearchField-
|
|
3
|
+
import { M as g } from "../../SearchField-CN2mo8ck.js";
|
|
4
4
|
import "../../index-p1eeF8LQ.js";
|
|
5
5
|
import "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import { jsxs as g, jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Button as
|
|
1
|
+
import { jsxs as g, Fragment as f, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as B, createElement as I } from "react";
|
|
3
|
+
import { Button as L } from "../Button/Button.js";
|
|
4
4
|
import "../../index-p1eeF8LQ.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import { useFilter as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ToolbarFilterMenu as O } from "./ToolbarFilterMenu.js";
|
|
7
|
+
import { useFilter as N } from "./useFilter.js";
|
|
8
|
+
import { ToolbarFilterAddMenu as O } from "./ToolbarFilterAddMenu.js";
|
|
9
|
+
import { ToolbarFilterMenu as w } from "./ToolbarFilterMenu.js";
|
|
11
10
|
import { S as y } from "../../XMark-tKk6aExO.js";
|
|
12
|
-
const
|
|
11
|
+
const U = ({
|
|
13
12
|
filters: n,
|
|
14
13
|
filterState: e = {},
|
|
15
14
|
onFilterStateChange: r,
|
|
16
|
-
addLabel:
|
|
17
|
-
addNextLabel:
|
|
18
|
-
resetLabel:
|
|
19
|
-
removeLabel:
|
|
20
|
-
submitLabel:
|
|
15
|
+
addLabel: b = "Legg til filter",
|
|
16
|
+
addNextLabel: v = "Legg til",
|
|
17
|
+
resetLabel: u = "Nullstill",
|
|
18
|
+
removeLabel: F = "Fjern filter",
|
|
19
|
+
submitLabel: h,
|
|
21
20
|
getFilterLabel: T,
|
|
22
21
|
virtualized: j
|
|
23
22
|
}) => {
|
|
24
|
-
const { visibleFilters:
|
|
23
|
+
const { visibleFilters: m, hiddenFilters: s, onFilterAdd: R, onFilterChange: k, onFilterRemove: i } = N({
|
|
25
24
|
filters: n,
|
|
26
25
|
filterState: e,
|
|
27
26
|
onFilterStateChange: r
|
|
28
|
-
}),
|
|
27
|
+
}), x = (n?.filter((o) => o.removable)?.length || 0) > 0 && Object.values(e)?.some((o) => o && o?.length > 0), A = n?.filter((o) => o.removable)?.map((o) => o.name) ?? [], [a, d] = B(void 0), p = (o) => {
|
|
29
28
|
d((t) => t === o ? void 0 : o);
|
|
30
29
|
}, c = () => {
|
|
31
30
|
d(void 0);
|
|
32
|
-
},
|
|
33
|
-
for (const o of
|
|
31
|
+
}, C = () => {
|
|
32
|
+
for (const o of A)
|
|
34
33
|
i(o);
|
|
35
34
|
r?.({});
|
|
36
35
|
};
|
|
37
|
-
return /* @__PURE__ */ g(
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
36
|
+
return /* @__PURE__ */ g(f, { children: [
|
|
37
|
+
m?.map((o, t) => {
|
|
38
|
+
const M = T?.(o?.name, e?.[o?.id]) ?? o?.label;
|
|
39
|
+
return /* @__PURE__ */ I(
|
|
40
|
+
w,
|
|
42
41
|
{
|
|
43
42
|
...o,
|
|
44
|
-
submitLabel:
|
|
43
|
+
submitLabel: h,
|
|
45
44
|
key: t,
|
|
46
45
|
onToggle: () => p(o.name),
|
|
47
46
|
onClose: c,
|
|
48
47
|
open: a === o.name,
|
|
49
|
-
label:
|
|
48
|
+
label: M,
|
|
50
49
|
onRemove: () => i(o.name),
|
|
51
|
-
removeLabel:
|
|
52
|
-
onFilterChange:
|
|
50
|
+
removeLabel: F,
|
|
51
|
+
onFilterChange: k,
|
|
53
52
|
onFilterStateChange: r,
|
|
54
53
|
filterState: e
|
|
55
54
|
}
|
|
56
55
|
);
|
|
57
56
|
}),
|
|
58
|
-
s?.length > 0 && /* @__PURE__ */
|
|
59
|
-
|
|
57
|
+
s?.length > 0 && /* @__PURE__ */ l(
|
|
58
|
+
O,
|
|
60
59
|
{
|
|
61
60
|
name: "add",
|
|
62
61
|
onToggle: () => p("add"),
|
|
63
62
|
onClose: c,
|
|
64
63
|
open: a === "add",
|
|
65
64
|
items: s,
|
|
66
|
-
onAdd:
|
|
67
|
-
label:
|
|
65
|
+
onAdd: R,
|
|
66
|
+
label: m?.length > 0 ? v : b,
|
|
68
67
|
virtualized: j
|
|
69
68
|
}
|
|
70
69
|
),
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
70
|
+
x && /* @__PURE__ */ g(L, { onClick: C, variant: "ghost", children: [
|
|
71
|
+
/* @__PURE__ */ l(y, { "aria-hidden": "true" }),
|
|
72
|
+
/* @__PURE__ */ l("span", { children: u })
|
|
74
73
|
] })
|
|
75
74
|
] });
|
|
76
75
|
};
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
U as ToolbarFilter
|
|
79
78
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as s, jsxs as
|
|
3
|
-
import u, { forwardRef as
|
|
4
|
-
import { Button as
|
|
2
|
+
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import u, { forwardRef as y, useRef as m, useEffect as w } from "react";
|
|
4
|
+
import { Button as b } from "../Button/Button.js";
|
|
5
5
|
import "../../index-p1eeF8LQ.js";
|
|
6
|
-
import { Dropdown as
|
|
6
|
+
import { Dropdown as O } from "../Dropdown/Dropdown.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { M as
|
|
9
|
-
import { useDropdownMenuController as
|
|
8
|
+
import { M as I } from "../../SearchField-CN2mo8ck.js";
|
|
9
|
+
import { useDropdownMenuController as x } from "../Menu/useDropdownMenuController.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { u as
|
|
12
|
-
var
|
|
11
|
+
import { u as R } from "../../useId-BVFxCjkq.js";
|
|
12
|
+
var j = function(t, a) {
|
|
13
13
|
var o = {};
|
|
14
14
|
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && a.indexOf(e) < 0 && (o[e] = t[e]);
|
|
15
15
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -17,9 +17,9 @@ var R = function(t, a) {
|
|
|
17
17
|
a.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (o[e[r]] = t[e[r]]);
|
|
18
18
|
return o;
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
var { title: o, titleId: e } = t, r =
|
|
22
|
-
let i =
|
|
20
|
+
const C = y((t, a) => {
|
|
21
|
+
var { title: o, titleId: e } = t, r = j(t, ["title", "titleId"]);
|
|
22
|
+
let i = R();
|
|
23
23
|
return i = o ? e || "title-" + i : void 0, u.createElement(
|
|
24
24
|
"svg",
|
|
25
25
|
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: a, "aria-labelledby": i }, r),
|
|
@@ -33,28 +33,30 @@ const j = v((t, a) => {
|
|
|
33
33
|
onAdd: e,
|
|
34
34
|
onToggle: r,
|
|
35
35
|
onClose: i,
|
|
36
|
-
open: n
|
|
36
|
+
open: n,
|
|
37
|
+
dropdownSize: p = "sm"
|
|
37
38
|
}) => {
|
|
38
|
-
const l =
|
|
39
|
+
const l = x({ id: "tool-filter-add" }), f = m(n), g = m(!1), c = a?.map((d) => ({
|
|
39
40
|
linkIcon: !0,
|
|
40
41
|
...d,
|
|
41
42
|
onClick: () => e?.(d?.name ?? "")
|
|
42
43
|
}));
|
|
43
|
-
if (
|
|
44
|
+
if (w(() => {
|
|
44
45
|
const d = f.current;
|
|
45
46
|
f.current = n, d && !n && l?.triggerRef?.current?.focus();
|
|
46
47
|
}, [n, l.triggerRef]), !c?.length)
|
|
47
48
|
return null;
|
|
48
|
-
const
|
|
49
|
+
const h = () => {
|
|
49
50
|
const d = document.getElementById(l.menuId);
|
|
50
|
-
|
|
51
|
+
g.current = !!d?.querySelector('[aria-haspopup="menu"][aria-expanded="true"]'), i();
|
|
51
52
|
};
|
|
52
53
|
return /* @__PURE__ */ s(
|
|
53
|
-
|
|
54
|
+
O,
|
|
54
55
|
{
|
|
55
56
|
variant: "drawer-dropdown",
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
size: p,
|
|
58
|
+
trigger: /* @__PURE__ */ v(
|
|
59
|
+
b,
|
|
58
60
|
{
|
|
59
61
|
variant: "secondary",
|
|
60
62
|
style: {
|
|
@@ -66,15 +68,15 @@ const j = v((t, a) => {
|
|
|
66
68
|
onClick: r,
|
|
67
69
|
ref: l.triggerRef,
|
|
68
70
|
children: [
|
|
69
|
-
/* @__PURE__ */ s(
|
|
71
|
+
/* @__PURE__ */ s(C, { "aria-hidden": "true", focusable: "false" }),
|
|
70
72
|
/* @__PURE__ */ s("span", { children: t })
|
|
71
73
|
]
|
|
72
74
|
}
|
|
73
75
|
),
|
|
74
76
|
open: n,
|
|
75
|
-
onClose:
|
|
77
|
+
onClose: h,
|
|
76
78
|
...l.dropdownA11yProps,
|
|
77
|
-
children: /* @__PURE__ */ s(
|
|
79
|
+
children: /* @__PURE__ */ s(I, { groups: o, items: c, maxLevels: 1, keyboardEvents: n, open: n, ...l.menuA11yProps })
|
|
78
80
|
}
|
|
79
81
|
);
|
|
80
82
|
};
|
|
@@ -1,116 +1,119 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as q, useEffect as G } from "react";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
4
|
import "../Button/Button.js";
|
|
5
|
-
import { M as
|
|
6
|
-
import { useDropdownMenuController as
|
|
5
|
+
import { M as H } from "../../SearchField-CN2mo8ck.js";
|
|
6
|
+
import { useDropdownMenuController as J } from "../Menu/useDropdownMenuController.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { Dropdown as
|
|
10
|
-
import { ToolbarFilterButton as
|
|
9
|
+
import { Dropdown as I } from "../Dropdown/Dropdown.js";
|
|
10
|
+
import { ToolbarFilterButton as R } from "./ToolbarFilterButton.js";
|
|
11
11
|
const L = ({
|
|
12
|
-
as:
|
|
13
|
-
size:
|
|
12
|
+
as: F,
|
|
13
|
+
size: s,
|
|
14
14
|
name: n,
|
|
15
|
-
label:
|
|
16
|
-
searchable:
|
|
15
|
+
label: a = "",
|
|
16
|
+
searchable: m,
|
|
17
17
|
groups: f,
|
|
18
18
|
items: l,
|
|
19
|
-
removable:
|
|
20
|
-
removeLabel:
|
|
21
|
-
filterState:
|
|
19
|
+
removable: P,
|
|
20
|
+
removeLabel: E = "Fjern filter",
|
|
21
|
+
filterState: d,
|
|
22
22
|
onFilterStateChange: p,
|
|
23
|
-
onFilterChange:
|
|
24
|
-
onRemove:
|
|
23
|
+
onFilterChange: j,
|
|
24
|
+
onRemove: C,
|
|
25
25
|
open: t,
|
|
26
26
|
onToggle: g,
|
|
27
27
|
onClose: u,
|
|
28
28
|
submitLabel: v,
|
|
29
|
-
search:
|
|
30
|
-
virtualized:
|
|
29
|
+
search: y,
|
|
30
|
+
virtualized: w,
|
|
31
31
|
title: b,
|
|
32
|
-
variant:
|
|
32
|
+
variant: D,
|
|
33
|
+
dropdownSize: x = "sm"
|
|
33
34
|
}) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const r =
|
|
37
|
-
|
|
35
|
+
const M = q(t), o = J({ id: "toolbar-filter-menu" });
|
|
36
|
+
G(() => {
|
|
37
|
+
const r = M.current;
|
|
38
|
+
M.current = t, r && !t && o?.triggerRef?.current?.focus();
|
|
38
39
|
}, [t, o.triggerRef]);
|
|
39
|
-
const
|
|
40
|
-
const c = r.target.type,
|
|
41
|
-
|
|
42
|
-
},
|
|
40
|
+
const O = (r) => {
|
|
41
|
+
const c = r.target.type, B = r.target.name, T = r.target.value;
|
|
42
|
+
j?.(c, B, T), c === "radio" && u();
|
|
43
|
+
}, h = l?.map((r) => ({
|
|
43
44
|
...r,
|
|
44
|
-
onChange: (c) =>
|
|
45
|
-
})),
|
|
46
|
-
return
|
|
47
|
-
|
|
45
|
+
onChange: (c) => O(c)
|
|
46
|
+
})), V = (l?.filter((r) => r.checked)?.map((r) => r.value || "true")).length > 0 || d?.[n]?.length, k = D || V ? "tinted" : "outline", A = F || H, i = m ? "combobox" : "menu";
|
|
47
|
+
return P ? /* @__PURE__ */ e(
|
|
48
|
+
I,
|
|
48
49
|
{
|
|
49
50
|
submitLabel: v,
|
|
50
51
|
title: b,
|
|
51
52
|
variant: "drawer-dropdown",
|
|
53
|
+
size: x,
|
|
52
54
|
trigger: /* @__PURE__ */ e(
|
|
53
|
-
|
|
55
|
+
R,
|
|
54
56
|
{
|
|
55
57
|
name: n,
|
|
56
58
|
onClick: g,
|
|
57
|
-
onRemove:
|
|
59
|
+
onRemove: C,
|
|
58
60
|
removable: !0,
|
|
59
|
-
variant:
|
|
60
|
-
removeLabel:
|
|
61
|
+
variant: k,
|
|
62
|
+
removeLabel: E,
|
|
61
63
|
open: t,
|
|
62
64
|
"aria-expanded": t,
|
|
63
65
|
"aria-controls": o.menuId,
|
|
64
66
|
ref: o.triggerRef,
|
|
65
|
-
children:
|
|
67
|
+
children: a
|
|
66
68
|
}
|
|
67
69
|
),
|
|
68
70
|
open: t,
|
|
69
71
|
onClose: u,
|
|
70
72
|
...o.dropdownA11yProps,
|
|
71
73
|
children: /* @__PURE__ */ e(
|
|
72
|
-
|
|
74
|
+
A,
|
|
73
75
|
{
|
|
74
|
-
search:
|
|
76
|
+
search: y,
|
|
75
77
|
name: n,
|
|
76
|
-
filterState:
|
|
78
|
+
filterState: d,
|
|
77
79
|
onFilterStateChange: p,
|
|
78
|
-
size:
|
|
79
|
-
searchable:
|
|
80
|
+
size: s,
|
|
81
|
+
searchable: m,
|
|
80
82
|
groups: f,
|
|
81
|
-
items:
|
|
83
|
+
items: h,
|
|
82
84
|
keyboardEvents: t,
|
|
83
85
|
a11yMode: i,
|
|
84
86
|
...i === "combobox" ? { id: o.menuId } : o.menuA11yProps,
|
|
85
|
-
virtualized:
|
|
87
|
+
virtualized: w
|
|
86
88
|
}
|
|
87
89
|
)
|
|
88
90
|
}
|
|
89
91
|
) : /* @__PURE__ */ e(
|
|
90
|
-
|
|
92
|
+
I,
|
|
91
93
|
{
|
|
94
|
+
size: x,
|
|
92
95
|
title: b,
|
|
93
96
|
variant: "drawer-dropdown",
|
|
94
97
|
submitLabel: v,
|
|
95
|
-
trigger: /* @__PURE__ */ e(
|
|
98
|
+
trigger: /* @__PURE__ */ e(R, { name: n, onClick: g, variant: k, children: a }),
|
|
96
99
|
open: t,
|
|
97
100
|
onClose: u,
|
|
98
101
|
...o.dropdownA11yProps,
|
|
99
102
|
children: /* @__PURE__ */ e(
|
|
100
|
-
|
|
103
|
+
A,
|
|
101
104
|
{
|
|
102
|
-
search:
|
|
105
|
+
search: y,
|
|
103
106
|
name: n,
|
|
104
|
-
filterState:
|
|
107
|
+
filterState: d,
|
|
105
108
|
onFilterStateChange: p,
|
|
106
|
-
size:
|
|
107
|
-
searchable:
|
|
109
|
+
size: s,
|
|
110
|
+
searchable: m,
|
|
108
111
|
groups: f,
|
|
109
|
-
items:
|
|
112
|
+
items: h,
|
|
110
113
|
keyboardEvents: t,
|
|
111
114
|
a11yMode: i,
|
|
112
115
|
...i === "combobox" ? { id: o.menuId } : o.menuA11yProps,
|
|
113
|
-
virtualized:
|
|
116
|
+
virtualized: w
|
|
114
117
|
}
|
|
115
118
|
)
|
|
116
119
|
}
|