@altinn/altinn-components 0.56.28 → 0.56.30
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/assets/AccountSelector.css +1 -1
- package/dist/assets/GlobalHeader.css +1 -1
- package/dist/assets/HeaderDrawer.css +1 -0
- package/dist/assets/HeaderDropdown.css +1 -0
- package/dist/components/Dropdown/Dropdown.js +50 -48
- package/dist/components/DsComponents/index.js +12 -12
- package/dist/components/GlobalHeader/AccountSelector.js +73 -70
- package/dist/components/GlobalHeader/GlobalHeader.js +65 -67
- package/dist/components/GlobalHeader/HeaderDrawer.js +138 -0
- package/dist/components/GlobalHeader/HeaderDropdown.js +26 -0
- package/dist/components/Toolbar/SelectDateFilter.js +19 -19
- package/dist/components/index.js +12 -12
- package/dist/heading-C_XYsUfi.js +12 -0
- package/dist/index.js +49 -49
- package/dist/{textfield-CNXt-27J.js → textfield-DP1SL4Wr.js} +496 -493
- package/dist/types/lib/components/Dropdown/Dropdown.d.ts +2 -1
- package/dist/types/lib/components/Dropdown/Dropdown.stories.d.ts +1 -1
- package/dist/types/lib/components/GlobalHeader/AccountSelector.d.ts +3 -3
- package/dist/types/lib/components/GlobalHeader/AccountSelector.stories.d.ts +1 -1
- package/dist/types/lib/components/GlobalHeader/HeaderDrawer.d.ts +11 -0
- package/dist/types/lib/components/GlobalHeader/HeaderDropdown.d.ts +9 -0
- package/package.json +1 -1
- package/dist/switch-Cemfhx0H.js +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._accountSelector_829wd_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_829wd_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_829wd_17{position:sticky;z-index:2;top:1rem;width:100%;padding:.5rem var(--horizontal-padding);display:flex;align-items:center;gap:1rem;margin-bottom:.75rem;background-color:#fff}._searchField_829wd_30{width:50%}._accountMenu_829wd_34{height:fit-content;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_829wd_34._virtualized_829wd_43{overflow-y:hidden}._btnIcon_829wd_48{font-size:1.5rem}._spinner_829wd_58{margin:auto;width:100%;overflow:hidden}@media(max-width:1023px){._accountSelector_829wd_1{--horizontal-padding: .1rem}._searchField_829wd_30{width:100%}._searchSection_829wd_17{flex-direction:column;align-items:stretch;gap:.5rem}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_57464_1{z-index:1;background-color:#fff;width:100%}._container_57464_7{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;padding:.625rem;width:100%;max-width:1512px;margin:0 auto}._backdrop_57464_19{display:none}._header_57464_1[data-current-id=menu],._header_57464_1[data-current-id=locale]{background-color:#fff}@media(min-width:1024px){._header_57464_1[data-current-id=menu] ._backdrop_57464_19,._header_57464_1[data-current-id=locale] ._backdrop_57464_19{display:block}}@media(max-width:1023px){._header_57464_1{gap:0}}._header_57464_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._nav_57464_53{position:relative;display:flex;align-items:center;justify-content:end;column-gap:.5rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
html:has(dialog[open]){overflow:hidden;scrollbar-gutter:stable}._backdrop_1f6gf_11{display:block;z-index:1;background-color:#111d4640;position:fixed;top:4.5rem;right:0;bottom:0;left:0;width:100%;height:100%}._backdrop_1f6gf_11[aria-hidden=true]{display:none}._drawer_1f6gf_28{position:fixed;z-index:2;background-color:#fff;width:100%;max-width:100vw;height:auto;max-height:auto;box-sizing:border-box;padding:0;margin:0;border:0;top:4.5rem;bottom:0;display:flex;flex-direction:column;overflow-y:scroll}._drawer_1f6gf_28::backdrop{background-color:transparent}._drawer_1f6gf_28:not([data-open=true]){display:none}._footer_1f6gf_60{display:none}._body_1f6gf_64{padding:0 .5rem}@media(min-width:1024px){._body_1f6gf_64{padding:0 1rem}._drawer_1f6gf_28{top:4.5rem;bottom:4.5rem}._drawer_1f6gf_28[data-expanded=true]{bottom:0}._footer_1f6gf_60{position:sticky;z-index:2000;display:flex;bottom:0;left:0;right:0;justify-content:center;align-items:center;background-color:#fff}._toggleButton_1f6gf_94{margin:1rem 0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dropdown_cdjbb_3[data-variant=drawer-dropdown] header{display:none}@media(max-width:1023px){._dropdown_cdjbb_3[data-variant=drawer-dropdown]{margin-top:4.5rem;box-shadow:none}}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as x, jsx as a, Fragment as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as R, useEffect as D, useState as
|
|
4
|
-
import { createPortal as
|
|
1
|
+
import { jsxs as x, jsx as a, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { c as O } from "../../index-p1eeF8LQ.js";
|
|
3
|
+
import { useRef as R, useEffect as D, useState as $, useCallback as G, useLayoutEffect as J } from "react";
|
|
4
|
+
import { createPortal as Q } from "react-dom";
|
|
5
5
|
import { Button as H } from "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import '../../assets/Dropdown.css';const
|
|
10
|
-
dropdown:
|
|
11
|
-
content:
|
|
12
|
-
backdrop:
|
|
13
|
-
header:
|
|
14
|
-
footer:
|
|
15
|
-
title:
|
|
16
|
-
},
|
|
8
|
+
import { S as V } from "../../XMark-tKk6aExO.js";
|
|
9
|
+
import '../../assets/Dropdown.css';const Z = "_dropdown_1mtdm_1", P = "_content_1mtdm_17", tt = "_backdrop_1mtdm_47", et = "_header_1mtdm_76", rt = "_footer_1mtdm_77", nt = "_title_1mtdm_148", m = {
|
|
10
|
+
dropdown: Z,
|
|
11
|
+
content: P,
|
|
12
|
+
backdrop: tt,
|
|
13
|
+
header: et,
|
|
14
|
+
footer: rt,
|
|
15
|
+
title: nt
|
|
16
|
+
}, ot = "data-focus-guard", z = (h) => {
|
|
17
17
|
const v = [
|
|
18
18
|
"a[href]",
|
|
19
19
|
"button:not([disabled])",
|
|
@@ -23,13 +23,13 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
|
|
|
23
23
|
'[tabindex]:not([tabindex="-1"])',
|
|
24
24
|
'[contenteditable="true"]'
|
|
25
25
|
].join(",");
|
|
26
|
-
return Array.from(h.querySelectorAll(v)).filter((c) => !c.hasAttribute(
|
|
26
|
+
return Array.from(h.querySelectorAll(v)).filter((c) => !c.hasAttribute(ot)).filter((c) => !c.hasAttribute("disabled")).filter((c) => c.getAttribute("aria-hidden") !== "true").filter((c) => c.tabIndex !== -1).filter((c) => {
|
|
27
27
|
const p = c.getClientRects();
|
|
28
28
|
return p.length > 0 && p[0].width > 0 && p[0].height > 0;
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, it = (h) => {
|
|
31
31
|
z(h)[0]?.focus({ preventScroll: !0 });
|
|
32
|
-
},
|
|
32
|
+
}, pt = ({
|
|
33
33
|
id: h = "dropdown",
|
|
34
34
|
size: v = "sm",
|
|
35
35
|
className: c,
|
|
@@ -45,36 +45,37 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
|
|
|
45
45
|
onClose: g,
|
|
46
46
|
onSubmit: I,
|
|
47
47
|
activeDescendantId: T,
|
|
48
|
-
useFixedPosition: l = !1
|
|
48
|
+
useFixedPosition: l = !1,
|
|
49
|
+
expanded: X = !1
|
|
49
50
|
}) => {
|
|
50
51
|
const b = R(null), u = R(null), S = R(r);
|
|
51
52
|
D(() => {
|
|
52
53
|
S.current = r;
|
|
53
54
|
}, [r]);
|
|
54
|
-
const [n,
|
|
55
|
+
const [n, Y] = $({
|
|
55
56
|
yDir: _.includes("top") ? "top" : "bottom",
|
|
56
57
|
xDir: _.includes("right") ? "right" : "left",
|
|
57
58
|
maxHeight: 300
|
|
58
|
-
}), f =
|
|
59
|
+
}), f = G(() => {
|
|
59
60
|
if (r && b.current && u.current) {
|
|
60
|
-
const t = b.current.getBoundingClientRect(),
|
|
61
|
-
|
|
62
|
-
...
|
|
63
|
-
yDir:
|
|
64
|
-
maxHeight:
|
|
65
|
-
xDir:
|
|
61
|
+
const t = b.current.getBoundingClientRect(), d = u.current.getBoundingClientRect(), o = window.innerHeight, e = window.innerWidth, i = 16, s = o - t.bottom, w = t.top, y = e - t.right - d.width, A = s < 250 && w > s, q = A ? "top" : "bottom", K = (A ? w : s) - i, U = y < i ? "right" : "left";
|
|
62
|
+
Y((W) => ({
|
|
63
|
+
...W,
|
|
64
|
+
yDir: q,
|
|
65
|
+
maxHeight: K,
|
|
66
|
+
xDir: U,
|
|
66
67
|
triggerRect: l ? t : void 0
|
|
67
68
|
}));
|
|
68
69
|
}
|
|
69
70
|
}, [r, l]);
|
|
70
|
-
|
|
71
|
+
J(() => (f(), window.addEventListener("resize", f), l && window.addEventListener("scroll", f, !0), () => {
|
|
71
72
|
window.removeEventListener("resize", f), l && window.removeEventListener("scroll", f, !0);
|
|
72
73
|
}), [f, l]), D(() => {
|
|
73
74
|
if (!r) return;
|
|
74
75
|
const t = requestAnimationFrame(() => {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
const o =
|
|
76
|
+
const d = u.current;
|
|
77
|
+
if (!d) return;
|
|
78
|
+
const o = d.querySelector(
|
|
78
79
|
'input[type="search"]:not([disabled]), input[role="searchbox"]:not([disabled]), input[data-dropdown-search]:not([disabled])'
|
|
79
80
|
);
|
|
80
81
|
if (o) {
|
|
@@ -86,28 +87,28 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
|
|
|
86
87
|
}
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
d.focus?.({ preventScroll: !0 });
|
|
90
91
|
});
|
|
91
92
|
return () => cancelAnimationFrame(t);
|
|
92
93
|
}, [r]), D(() => {
|
|
93
94
|
const t = (o) => {
|
|
94
95
|
o.key === "Escape" && g();
|
|
95
|
-
},
|
|
96
|
-
const e = o.target, i = b.current?.contains(e),
|
|
97
|
-
!i && !
|
|
96
|
+
}, d = (o) => {
|
|
97
|
+
const e = o.target, i = b.current?.contains(e), s = u.current?.contains(e);
|
|
98
|
+
!i && !s && g();
|
|
98
99
|
};
|
|
99
|
-
return r && (document.addEventListener("mousedown",
|
|
100
|
-
document.removeEventListener("mousedown",
|
|
100
|
+
return r && (document.addEventListener("mousedown", d), document.addEventListener("keydown", t)), () => {
|
|
101
|
+
document.removeEventListener("mousedown", d), document.removeEventListener("keydown", t);
|
|
101
102
|
};
|
|
102
103
|
}, [r, g]), D(() => {
|
|
103
104
|
if (!r) return;
|
|
104
105
|
const t = u.current;
|
|
105
106
|
if (!t) return;
|
|
106
|
-
const
|
|
107
|
+
const d = (e) => {
|
|
107
108
|
if (!S.current)
|
|
108
109
|
return;
|
|
109
110
|
const i = e.target;
|
|
110
|
-
i && !t.contains(i) &&
|
|
111
|
+
i && !t.contains(i) && it(t);
|
|
111
112
|
}, o = (e) => {
|
|
112
113
|
if (e.key !== "Tab") return;
|
|
113
114
|
const i = z(t);
|
|
@@ -115,14 +116,14 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
|
|
|
115
116
|
e.preventDefault(), t.focus?.({ preventScroll: !0 });
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
|
-
const
|
|
119
|
-
e.shiftKey ? y ===
|
|
119
|
+
const s = i[0], w = i[i.length - 1], y = document.activeElement;
|
|
120
|
+
e.shiftKey ? y === s && (e.preventDefault(), w.focus({ preventScroll: !0 })) : y === w && (e.preventDefault(), s.focus({ preventScroll: !0 }));
|
|
120
121
|
};
|
|
121
|
-
return document.addEventListener("focusin",
|
|
122
|
-
document.removeEventListener("focusin",
|
|
122
|
+
return document.addEventListener("focusin", d), document.addEventListener("keydown", o), () => {
|
|
123
|
+
document.removeEventListener("focusin", d), document.removeEventListener("keydown", o);
|
|
123
124
|
};
|
|
124
125
|
}, [r]);
|
|
125
|
-
const
|
|
126
|
+
const j = l && n.triggerRect ? {
|
|
126
127
|
position: "fixed",
|
|
127
128
|
zIndex: 1e3,
|
|
128
129
|
width: "max-content",
|
|
@@ -142,10 +143,11 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
|
|
|
142
143
|
"div",
|
|
143
144
|
{
|
|
144
145
|
ref: u,
|
|
145
|
-
className:
|
|
146
|
-
style:
|
|
146
|
+
className: O(m.dropdown, c),
|
|
147
|
+
style: j,
|
|
147
148
|
"aria-hidden": !r,
|
|
148
149
|
"data-variant": E,
|
|
150
|
+
"data-expanded": X,
|
|
149
151
|
"data-size": v,
|
|
150
152
|
tabIndex: -1,
|
|
151
153
|
role: "menu",
|
|
@@ -154,21 +156,21 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
|
|
|
154
156
|
children: [
|
|
155
157
|
/* @__PURE__ */ x("header", { className: m.header, children: [
|
|
156
158
|
/* @__PURE__ */ a("h2", { className: m.title, children: C }),
|
|
157
|
-
/* @__PURE__ */ a(H, { size: "sm", variant: "outline", onClick: g, "aria-label": F, children: /* @__PURE__ */ a(
|
|
159
|
+
/* @__PURE__ */ a(H, { size: "sm", variant: "outline", onClick: g, "aria-label": F, children: /* @__PURE__ */ a(V, {}) })
|
|
158
160
|
] }),
|
|
159
161
|
/* @__PURE__ */ a("div", { className: m.content, children: B }),
|
|
160
162
|
k && /* @__PURE__ */ a("footer", { className: m.footer, children: /* @__PURE__ */ a(H, { size: "lg", variant: "solid", onClick: I || g, rounded: !0, children: /* @__PURE__ */ a("span", { "data-size": "md", children: k }) }) })
|
|
161
163
|
]
|
|
162
164
|
}
|
|
163
165
|
);
|
|
164
|
-
return /* @__PURE__ */ x(
|
|
166
|
+
return /* @__PURE__ */ x(M, { children: [
|
|
165
167
|
p && /* @__PURE__ */ a("div", { className: m.backdrop, "aria-hidden": !r }),
|
|
166
168
|
/* @__PURE__ */ x("div", { id: h + "-root", ref: b, style: { position: "relative", display: "inline-block" }, children: [
|
|
167
169
|
N,
|
|
168
|
-
l ?
|
|
170
|
+
l ? Q(L, document.body) : L
|
|
169
171
|
] })
|
|
170
172
|
] });
|
|
171
173
|
};
|
|
172
174
|
export {
|
|
173
|
-
|
|
175
|
+
pt as Dropdown
|
|
174
176
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { A as o } from "../../alert-BzifOfXl.js";
|
|
2
|
-
import { B as e, C as r, a as t, b as i, D as n, L as p, c as x, d as f, P as m, e as g,
|
|
3
|
-
import { B
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { B as e, C as r, a as t, b as i, D as n, L as p, c as x, d as f, P as m, e as g, f as d, g as h, S as l, h as P, T as S, u as b } from "../../textfield-DP1SL4Wr.js";
|
|
3
|
+
import { B, S as C } from "../../button-BB5sYVKY.js";
|
|
4
|
+
import { D as k } from "../../index-Q0EA2XB0.js";
|
|
5
|
+
import { H as T } from "../../heading-C_XYsUfi.js";
|
|
6
6
|
import { P as H } from "../../paragraph-BRiIBpbY.js";
|
|
7
7
|
import { V as v } from "../../index-z82sbSVU.js";
|
|
8
8
|
export {
|
|
9
9
|
o as DsAlert,
|
|
10
10
|
e as DsBadge,
|
|
11
|
-
|
|
11
|
+
B as DsButton,
|
|
12
12
|
r as DsCheckbox,
|
|
13
13
|
t as DsChip,
|
|
14
14
|
i as DsCombobox,
|
|
15
|
-
|
|
15
|
+
k as DsDetails,
|
|
16
16
|
n as DsDialog,
|
|
17
|
-
|
|
17
|
+
T as DsHeading,
|
|
18
18
|
p as DsLink,
|
|
19
19
|
x as DsListItem,
|
|
20
20
|
f as DsListUnordered,
|
|
@@ -22,11 +22,11 @@ export {
|
|
|
22
22
|
H as DsParagraph,
|
|
23
23
|
g as DsPopover,
|
|
24
24
|
d as DsSearch,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
h as DsSkeleton,
|
|
26
|
+
C as DsSpinner,
|
|
27
|
+
l as DsSwitch,
|
|
28
|
+
P as DsTabs,
|
|
29
|
+
S as DsTextfield,
|
|
30
30
|
v as DsValidationMessage,
|
|
31
31
|
b as useDsPagination
|
|
32
32
|
};
|
|
@@ -1,112 +1,115 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import { AccountMenu as A } from "../Account/AccountMenu.js";
|
|
1
|
+
import { jsx as a, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { c as f } from "../../index-p1eeF8LQ.js";
|
|
3
|
+
import { useState as g, useEffect as z } from "react";
|
|
4
|
+
import { AccountMenu as N } from "../Account/AccountMenu.js";
|
|
6
5
|
import "../Button/Button.js";
|
|
7
6
|
import "react-dom";
|
|
8
|
-
import { useRootContext as
|
|
7
|
+
import { useRootContext as k } from "../RootProvider/RootProvider.js";
|
|
9
8
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import {
|
|
11
|
-
import { S as
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
import { Switch as A } from "../Forms/Switch.js";
|
|
10
|
+
import { S as L } from "../../SearchField-QTfebYdU.js";
|
|
11
|
+
import { S as H } from "../../button-BB5sYVKY.js";
|
|
12
|
+
import { H as T } from "../../heading-C_XYsUfi.js";
|
|
13
|
+
import '../../assets/AccountSelector.css';const y = "_accountSelector_829wd_1", C = "_heading_829wd_11", F = "_searchSection_829wd_17", R = "_searchField_829wd_30", j = "_accountMenu_829wd_34", E = "_virtualized_829wd_43", M = "_spinner_829wd_58", t = {
|
|
14
|
+
accountSelector: y,
|
|
15
|
+
heading: C,
|
|
16
|
+
searchSection: F,
|
|
17
|
+
searchField: R,
|
|
18
|
+
accountMenu: j,
|
|
19
|
+
virtualized: E,
|
|
20
|
+
spinner: M
|
|
21
|
+
}, D = ({
|
|
22
22
|
accountMenu: e,
|
|
23
|
-
forceOpenFullScreen:
|
|
24
|
-
className:
|
|
25
|
-
loading:
|
|
23
|
+
forceOpenFullScreen: r,
|
|
24
|
+
className: n,
|
|
25
|
+
loading: p,
|
|
26
26
|
showDeletedUnits: s,
|
|
27
|
-
onShowDeletedUnitsChange:
|
|
28
|
-
|
|
27
|
+
onShowDeletedUnitsChange: v,
|
|
28
|
+
isFullScreen: i
|
|
29
29
|
}) => {
|
|
30
|
-
const {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
a === !0 && o("account");
|
|
37
|
-
}, [a, o]);
|
|
38
|
-
const { searchText: f, heading: b, switchLabel: w } = B(d), N = (r) => {
|
|
39
|
-
e.onSelectAccount?.(r), l(), m(!1);
|
|
30
|
+
const { closeAll: o, languageCode: l } = k(), [d, h] = g(""), [_, u] = g(r);
|
|
31
|
+
z(() => {
|
|
32
|
+
!r && _ && o(), u(r);
|
|
33
|
+
}, [r]);
|
|
34
|
+
const { searchText: m, heading: w, switchLabel: x } = V(l), b = (c) => {
|
|
35
|
+
e.onSelectAccount?.(c), o(), u(!1);
|
|
40
36
|
};
|
|
41
|
-
return
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */ S("div", { className:
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
37
|
+
return p ? /* @__PURE__ */ a(H, { "aria-hidden": !0, "data-color": "neutral", className: t.spinner }) : /* @__PURE__ */ S("div", { className: f(n, t.accountSelector), children: [
|
|
38
|
+
/* @__PURE__ */ a(T, { "data-size": "sm", level: 2, className: t.heading, children: w }),
|
|
39
|
+
/* @__PURE__ */ S("div", { className: t.searchSection, children: [
|
|
40
|
+
/* @__PURE__ */ a(
|
|
41
|
+
L,
|
|
46
42
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
size: "sm",
|
|
44
|
+
name: m,
|
|
45
|
+
placeholder: m,
|
|
46
|
+
value: d,
|
|
47
|
+
onChange: (c) => h(c.target.value),
|
|
51
48
|
onClear: () => h(""),
|
|
52
|
-
className:
|
|
49
|
+
className: t.searchField
|
|
53
50
|
}
|
|
54
51
|
),
|
|
55
|
-
s !== void 0 && /* @__PURE__ */
|
|
56
|
-
|
|
52
|
+
s !== void 0 && /* @__PURE__ */ a(
|
|
53
|
+
A,
|
|
57
54
|
{
|
|
55
|
+
size: "sm",
|
|
58
56
|
checked: s,
|
|
59
|
-
onChange: (
|
|
60
|
-
label:
|
|
57
|
+
onChange: (c) => v?.(c.target.checked),
|
|
58
|
+
label: x
|
|
61
59
|
}
|
|
62
60
|
)
|
|
63
61
|
] }),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
|
+
"div",
|
|
66
64
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
className: f(
|
|
66
|
+
t.accountMenu,
|
|
67
|
+
i && t.fullScreen,
|
|
68
|
+
e.virtualized && t.virtualized
|
|
69
|
+
),
|
|
70
|
+
children: /* @__PURE__ */ a(
|
|
71
|
+
N,
|
|
72
|
+
{
|
|
73
|
+
...e,
|
|
74
|
+
onSelectAccount: b,
|
|
75
|
+
keyboardEvents: !1,
|
|
76
|
+
search: {
|
|
77
|
+
hidden: !0,
|
|
78
|
+
name: "",
|
|
79
|
+
value: d,
|
|
80
|
+
getResultsLabel: (c) => $(c, l)
|
|
81
|
+
},
|
|
82
|
+
scrollRefStyles: !i && e.virtualized ? { maxHeight: "calc(40vh)" } : void 0
|
|
83
|
+
}
|
|
84
|
+
)
|
|
76
85
|
}
|
|
77
|
-
)
|
|
86
|
+
)
|
|
78
87
|
] });
|
|
79
|
-
},
|
|
88
|
+
}, V = (e) => {
|
|
80
89
|
switch (e) {
|
|
81
90
|
case "nn":
|
|
82
91
|
return {
|
|
83
|
-
minimize: "Minimer",
|
|
84
|
-
fullscreen: "Vis i fullskjerm",
|
|
85
92
|
searchText: "Søk i aktørar",
|
|
86
93
|
heading: "Kven vil du representere?",
|
|
87
94
|
switchLabel: "Vis slettede"
|
|
88
95
|
};
|
|
89
96
|
case "en":
|
|
90
97
|
return {
|
|
91
|
-
minimize: "Minimize",
|
|
92
|
-
fullscreen: "Show in fullscreen",
|
|
93
98
|
searchText: "Search in actors",
|
|
94
99
|
heading: "Who do you want to represent?",
|
|
95
100
|
switchLabel: "Show deleted"
|
|
96
101
|
};
|
|
97
102
|
default:
|
|
98
103
|
return {
|
|
99
|
-
minimize: "Minimer",
|
|
100
|
-
fullscreen: "Vis i fullskjerm",
|
|
101
104
|
searchText: "Søk i aktører",
|
|
102
105
|
heading: "Hvem vil du representere?",
|
|
103
106
|
switchLabel: "Vis slettede"
|
|
104
107
|
};
|
|
105
108
|
}
|
|
106
|
-
},
|
|
107
|
-
const
|
|
108
|
-
return e === 0 ?
|
|
109
|
+
}, $ = (e, r) => {
|
|
110
|
+
const n = r === "nb" || r === "nn";
|
|
111
|
+
return e === 0 ? n ? "Ingen treff" : "No hits" : n ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
|
|
109
112
|
};
|
|
110
113
|
export {
|
|
111
|
-
|
|
114
|
+
D as AccountSelector
|
|
112
115
|
};
|
|
@@ -1,91 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as n, jsxs as a, Fragment as F } from "react/jsx-runtime";
|
|
3
|
+
import { useState as A } from "react";
|
|
4
|
+
import { useIsDesktop as v } from "../../hooks/useIsDesktop.js";
|
|
5
|
+
import { GlobalMenu as C } from "../GlobalMenu/GlobalMenu.js";
|
|
4
6
|
import "../../index-p1eeF8LQ.js";
|
|
5
|
-
import "react";
|
|
6
7
|
import "../Button/Button.js";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import { useRootContext as b } from "../RootProvider/RootProvider.js";
|
|
10
|
+
import { GlobalMenuButton as k } from "./GlobalMenuButton.js";
|
|
9
11
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { HeaderLogo as
|
|
15
|
-
import '../../assets/GlobalHeader.css';const
|
|
16
|
-
header:
|
|
17
|
-
container:
|
|
18
|
-
nav:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
globalMenu: t,
|
|
12
|
+
import { AccountSelector as D } from "./AccountSelector.js";
|
|
13
|
+
import { AccountSelectorButton as H } from "./AccountSelectorButton.js";
|
|
14
|
+
import { HeaderDrawer as N } from "./HeaderDrawer.js";
|
|
15
|
+
import { HeaderDropdown as w } from "./HeaderDropdown.js";
|
|
16
|
+
import { HeaderLogo as y } from "./HeaderLogo.js";
|
|
17
|
+
import '../../assets/GlobalHeader.css';const B = "_header_57464_1", G = "_container_57464_7", I = "_nav_57464_53", t = {
|
|
18
|
+
header: B,
|
|
19
|
+
container: G,
|
|
20
|
+
nav: I
|
|
21
|
+
}, W = ({
|
|
22
|
+
globalMenu: r,
|
|
22
23
|
desktopMenu: m,
|
|
23
24
|
mobileMenu: p,
|
|
24
25
|
locale: u,
|
|
25
26
|
accountSelector: e,
|
|
26
|
-
logo:
|
|
27
|
-
badge:
|
|
28
|
-
onLoginClick:
|
|
27
|
+
logo: f = {},
|
|
28
|
+
badge: h,
|
|
29
|
+
onLoginClick: g
|
|
29
30
|
}) => {
|
|
30
|
-
const { currentId:
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
return /* @__PURE__ */ n("header", { className:
|
|
36
|
-
/* @__PURE__ */ n(
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
e && /* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
31
|
+
const { currentId: o, toggleId: i, closeAll: c } = b(), x = () => {
|
|
32
|
+
i("account");
|
|
33
|
+
}, O = () => {
|
|
34
|
+
i("menu");
|
|
35
|
+
}, l = o === "account" || e?.forceOpenFullScreen || !1, [d, _] = A(!1), s = v();
|
|
36
|
+
return /* @__PURE__ */ n("header", { className: t.header, "data-current-id": o, children: /* @__PURE__ */ a("div", { className: t.container, children: [
|
|
37
|
+
/* @__PURE__ */ n(y, { ...f, badge: h, className: t.logo }),
|
|
38
|
+
/* @__PURE__ */ a("nav", { className: t.nav, children: [
|
|
39
|
+
e && /* @__PURE__ */ a(F, { children: [
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
|
+
H,
|
|
42
|
+
{
|
|
43
|
+
currentAccount: e.accountMenu?.currentAccount,
|
|
44
|
+
minimized: !s,
|
|
45
|
+
onClick: e.accountMenu?.currentAccount ? x : g,
|
|
46
|
+
expanded: l,
|
|
47
|
+
loading: e.loading,
|
|
48
|
+
disabled: e.forceOpenFullScreen
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ n(
|
|
52
|
+
N,
|
|
53
|
+
{
|
|
54
|
+
id: "header-account",
|
|
55
|
+
open: l,
|
|
56
|
+
onClose: c,
|
|
57
|
+
closedBy: e?.forceOpenFullScreen ? "none" : "any",
|
|
58
|
+
expanded: e?.forceOpenFullScreen || d,
|
|
59
|
+
onToggle: () => _(!d),
|
|
60
|
+
children: /* @__PURE__ */ n(D, { ...e, forceOpenFullScreen: e.forceOpenFullScreen })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
62
64
|
/* @__PURE__ */ n(
|
|
63
|
-
|
|
65
|
+
w,
|
|
64
66
|
{
|
|
65
|
-
className: o.dropdown,
|
|
66
67
|
id: "header-menu",
|
|
67
|
-
open:
|
|
68
|
-
variant: "drawer-dropdown",
|
|
69
|
-
placement: "right",
|
|
70
|
-
size: "md",
|
|
68
|
+
open: o === "menu",
|
|
71
69
|
onClose: c,
|
|
72
70
|
trigger: /* @__PURE__ */ n(
|
|
73
|
-
|
|
71
|
+
k,
|
|
74
72
|
{
|
|
75
|
-
onClick:
|
|
76
|
-
expanded:
|
|
73
|
+
onClick: O,
|
|
74
|
+
expanded: o === "menu",
|
|
77
75
|
disabled: e?.forceOpenFullScreen,
|
|
78
|
-
label:
|
|
76
|
+
label: r?.menuLabel
|
|
79
77
|
}
|
|
80
78
|
),
|
|
81
79
|
children: /* @__PURE__ */ n(
|
|
82
|
-
|
|
80
|
+
C,
|
|
83
81
|
{
|
|
84
|
-
...
|
|
85
|
-
menu:
|
|
82
|
+
...r,
|
|
83
|
+
menu: s ? m || r?.menu : p || r?.menu,
|
|
86
84
|
onClose: c,
|
|
87
85
|
localeSwitcher: u,
|
|
88
|
-
isOpen:
|
|
86
|
+
isOpen: o === "menu"
|
|
89
87
|
}
|
|
90
88
|
)
|
|
91
89
|
}
|
|
@@ -94,5 +92,5 @@ import '../../assets/GlobalHeader.css';const k = "_header_1urgv_1", F = "_contai
|
|
|
94
92
|
] }) });
|
|
95
93
|
};
|
|
96
94
|
export {
|
|
97
|
-
|
|
95
|
+
W as GlobalHeader
|
|
98
96
|
};
|