@altinn/altinn-components 0.56.0 → 0.56.2
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/DatepickerTable.css +1 -1
- package/dist/assets/Dropdown.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/Datepicker/DatepickerTable.js +6 -6
- 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 +1 -1
- 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/Settings/BookmarksSettingsList.js +25 -25
- package/dist/components/Toolbar/SelectDateFilter.js +20 -20
- 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/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
|
@@ -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,44 +1,44 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as i, Fragment as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as c, createElement as g } from "react";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
|
-
import { Typography as
|
|
5
|
-
import { Heading as
|
|
4
|
+
import { Typography as h } from "../Typography/Typography.js";
|
|
5
|
+
import { Heading as f } from "../Typography/Heading.js";
|
|
6
6
|
import "../Button/Button.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { Divider as
|
|
9
|
-
import { List as
|
|
8
|
+
import { Divider as k } from "../Divider/Divider.js";
|
|
9
|
+
import { List as x } from "../List/List.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { Flex as
|
|
11
|
+
import { Flex as F } from "../Page/Flex.js";
|
|
12
12
|
import { SettingsSection as S } from "./SettingsSection.js";
|
|
13
13
|
import { BookmarksSettingsItem as u } from "./BookmarksSettingsItem.js";
|
|
14
|
-
const
|
|
15
|
-
loading:
|
|
16
|
-
title:
|
|
17
|
-
description:
|
|
14
|
+
const $ = ({
|
|
15
|
+
loading: e,
|
|
16
|
+
title: n,
|
|
17
|
+
description: m,
|
|
18
18
|
items: t,
|
|
19
|
-
untitled:
|
|
19
|
+
untitled: l = "Untitled bookmark",
|
|
20
20
|
expandedId: d,
|
|
21
|
-
onToggle:
|
|
22
|
-
}) => /* @__PURE__ */ i(
|
|
23
|
-
/* @__PURE__ */ o(
|
|
24
|
-
t.length > 0 && /* @__PURE__ */ i(
|
|
25
|
-
/* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(
|
|
26
|
-
a > 0 && /* @__PURE__ */ o(
|
|
27
|
-
/* @__PURE__ */
|
|
21
|
+
onToggle: p
|
|
22
|
+
}) => /* @__PURE__ */ i(s, { children: [
|
|
23
|
+
/* @__PURE__ */ o(f, { size: "lg", children: n }),
|
|
24
|
+
t.length > 0 && /* @__PURE__ */ i(F, { direction: "col", spacing: 4, children: [
|
|
25
|
+
/* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(x, { size: "sm", children: t.map((r, a) => /* @__PURE__ */ i(c, { children: [
|
|
26
|
+
a > 0 && /* @__PURE__ */ o(k, {}),
|
|
27
|
+
/* @__PURE__ */ g(
|
|
28
28
|
u,
|
|
29
29
|
{
|
|
30
30
|
...r,
|
|
31
31
|
key: r.id,
|
|
32
|
-
title: r?.title ||
|
|
33
|
-
loading:
|
|
34
|
-
onToggle: () =>
|
|
32
|
+
title: r?.title || l,
|
|
33
|
+
loading: e || r.loading,
|
|
34
|
+
onToggle: () => p?.(r.id),
|
|
35
35
|
expanded: d === r.id
|
|
36
36
|
}
|
|
37
37
|
)
|
|
38
|
-
] })) }) }),
|
|
39
|
-
/* @__PURE__ */ o(
|
|
38
|
+
] }, r.id)) }) }),
|
|
39
|
+
/* @__PURE__ */ o(h, { color: "neutral", variant: "subtle", size: "xs", children: /* @__PURE__ */ o("p", { children: m }) })
|
|
40
40
|
] })
|
|
41
41
|
] });
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
$ as BookmarksSettingsList
|
|
44
44
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
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";
|
|
@@ -9,42 +9,42 @@ import { DatepickerFilter as C } from "./DatepickerFilter.js";
|
|
|
9
9
|
import { formatDateRange as h } from "./formatDateRange.js";
|
|
10
10
|
const q = ({
|
|
11
11
|
name: t = "time",
|
|
12
|
-
size:
|
|
13
|
-
searchable:
|
|
14
|
-
keyboardEvents:
|
|
15
|
-
items:
|
|
12
|
+
size: c,
|
|
13
|
+
searchable: m,
|
|
14
|
+
keyboardEvents: s,
|
|
15
|
+
items: D,
|
|
16
16
|
groups: d,
|
|
17
|
-
filterState:
|
|
17
|
+
filterState: e = {},
|
|
18
18
|
onFilterStateChange: r
|
|
19
19
|
}) => {
|
|
20
|
-
const [
|
|
20
|
+
const [f, i] = b(!1), a = e?.fromDate?.[0] || "", n = e?.toDate?.[0] || "", u = () => {
|
|
21
21
|
i(!1);
|
|
22
|
-
},
|
|
22
|
+
}, k = (o) => {
|
|
23
23
|
r?.({
|
|
24
|
-
...
|
|
25
|
-
fromDate:
|
|
26
|
-
toDate:
|
|
24
|
+
...e,
|
|
25
|
+
fromDate: o.fromDate ? [o.fromDate] : void 0,
|
|
26
|
+
toDate: o.toDate ? [o.toDate] : void 0,
|
|
27
27
|
[t]: ["fromAndToDate"]
|
|
28
28
|
});
|
|
29
|
-
},
|
|
30
|
-
...
|
|
31
|
-
description:
|
|
32
|
-
selected:
|
|
29
|
+
}, l = h(a, n), v = D?.map((o) => o.role === "datepicker" ? {
|
|
30
|
+
...o,
|
|
31
|
+
description: l,
|
|
32
|
+
selected: e?.[t]?.[0] === "fromAndToDate",
|
|
33
33
|
onClick: () => {
|
|
34
34
|
i(!0);
|
|
35
35
|
}
|
|
36
36
|
} : {
|
|
37
|
-
...
|
|
37
|
+
...o,
|
|
38
38
|
onChange: () => {
|
|
39
39
|
r?.({
|
|
40
|
-
...
|
|
40
|
+
...e,
|
|
41
41
|
fromDate: void 0,
|
|
42
42
|
toDate: void 0,
|
|
43
|
-
[t]:
|
|
43
|
+
[t]: o?.value ? [o.value] : void 0
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
return
|
|
47
|
+
return f ? /* @__PURE__ */ p(C, { formData: { fromDate: a, toDate: n }, onChange: k, onSubmit: u }) : /* @__PURE__ */ p(g, { size: c, searchable: m, keyboardEvents: s, items: v, groups: d });
|
|
48
48
|
};
|
|
49
49
|
export {
|
|
50
50
|
q as SelectDateFilter
|
|
@@ -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
|
}
|