@altinn/altinn-components 0.56.20 → 0.56.22
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/AccountSelectorButton.css +1 -0
- package/dist/assets/DatepickerFilter.css +1 -1
- package/dist/assets/Dropdown.css +1 -1
- package/dist/assets/GlobalHeader.css +1 -1
- package/dist/assets/GlobalMenuButton2.css +1 -1
- package/dist/assets/HeaderLogo2.css +1 -1
- package/dist/assets/LayoutGrid.css +1 -1
- package/dist/assets/ModalBase.css +1 -1
- package/dist/assets/ModalFooter.css +1 -0
- package/dist/assets/SettingsSection.css +1 -1
- package/dist/components/Account/AccountMenu.js +20 -20
- package/dist/components/Bookmarks/BookmarkSettingsList.js +41 -11
- package/dist/components/Dropdown/Dropdown.js +10 -10
- package/dist/components/DsComponents/index.js +20 -21
- package/dist/components/GlobalHeader/AccountSelector.js +64 -124
- package/dist/components/GlobalHeader/AccountSelectorButton.js +127 -0
- package/dist/components/GlobalHeader/DigdirLogomark.js +23 -109
- package/dist/components/GlobalHeader/GlobalHeader.js +84 -117
- package/dist/components/GlobalHeader/GlobalMenuButton.js +64 -0
- package/dist/components/GlobalHeader/HeaderLogo.js +20 -13
- package/dist/components/GlobalHeader/index.js +2 -2
- package/dist/components/GlobalMenu/GlobalMenu.js +11 -10
- package/dist/components/GlobalMenu/index.js +2 -4
- package/dist/components/Layout/Layout.js +30 -30
- package/dist/components/Layout/LayoutGrid.js +3 -3
- package/dist/components/Modal/ModalBase.js +35 -33
- package/dist/components/Modal/ModalFooter.js +7 -10
- package/dist/components/Modal/index.js +8 -6
- package/dist/components/Settings/SettingsItem.js +53 -35
- package/dist/components/Settings/SettingsItemBase.js +19 -20
- package/dist/components/Settings/SettingsSection.js +10 -10
- package/dist/components/index.js +89 -88
- package/dist/functions/index.js +6 -4
- package/dist/functions/orgno/index.js +4 -0
- package/dist/functions/orgno/orgno.js +4 -0
- package/dist/hooks/useAccountSelector.js +77 -75
- package/dist/index.js +88 -85
- package/dist/textfield-CNXt-27J.js +3403 -0
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsItem.d.ts +2 -0
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.d.ts +7 -1
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.stories.d.ts +4 -1
- package/dist/types/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/types/lib/components/{Account/AccountMenuButton.d.ts → GlobalHeader/AccountSelectorButton.d.ts} +2 -2
- package/dist/types/lib/components/{Account/AccountMenuButton.stories.d.ts → GlobalHeader/AccountSelectorButton.stories.d.ts} +1 -1
- package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +1 -2
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.d.ts +1 -3
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +1 -1
- package/dist/types/lib/components/{GlobalMenu → GlobalHeader}/GlobalMenuButton.d.ts +2 -2
- package/dist/types/lib/components/{GlobalMenu → GlobalHeader}/GlobalMenuButton.stories.d.ts +1 -1
- package/dist/types/lib/components/GlobalHeader/index.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu/index.d.ts +0 -1
- package/dist/types/lib/components/Modal/ModalBase.d.ts +2 -1
- package/dist/types/lib/components/Modal/ModalFooter.d.ts +3 -3
- package/dist/types/lib/components/Modal/index.d.ts +1 -0
- package/dist/types/lib/components/Settings/SettingsModal.stories.d.ts +2 -1
- package/dist/types/lib/functions/index.d.ts +1 -0
- package/dist/types/lib/functions/orgno/index.d.ts +1 -0
- package/dist/types/lib/functions/orgno/orgno.d.ts +1 -0
- package/package.json +1 -1
- package/dist/assets/AccountMenuButton.css +0 -1
- package/dist/assets/GlobalHeaderBase.css +0 -1
- package/dist/assets/HeaderGroup2.css +0 -1
- package/dist/assets/globalSearch.css +0 -1
- package/dist/components/Account/AccountMenuButton.js +0 -134
- package/dist/components/GlobalHeader/GlobalHeaderBase.js +0 -24
- package/dist/components/GlobalHeader/GlobalSearch.js +0 -62
- package/dist/components/GlobalHeader/GlobalSearchButton.js +0 -54
- package/dist/components/GlobalHeader/HeaderGroup.js +0 -8
- package/dist/components/GlobalMenu/GlobalMenuButton.js +0 -83
- package/dist/globalSearch.module-DziLSGZg.js +0 -9
- package/dist/index--jNxJmA8.js +0 -2000
- package/dist/textfield-Drdr9bio.js +0 -1439
- package/dist/types/lib/components/GlobalHeader/GlobalHeaderBase.d.ts +0 -9
- package/dist/types/lib/components/GlobalHeader/GlobalSearch.d.ts +0 -4
- package/dist/types/lib/components/GlobalHeader/GlobalSearchButton.d.ts +0 -6
- package/dist/types/lib/components/GlobalHeader/HeaderGroup.d.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._accountSelector_139de_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_139de_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_139de_17{width:100%;padding:0 var(--horizontal-padding);display:flex;align-items:center;gap:1rem;margin-bottom:.75rem}._searchField_139de_26{width:50%}._accountMenu_139de_30{height:fit-content;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_139de_30._virtualized_139de_38{overflow-y:hidden}._btnIcon_139de_43{font-size:1.5rem}._spinner_139de_47{margin:auto;width:100%;overflow:hidden}@media(max-width:1023px){._accountSelector_139de_1{--horizontal-padding: .1rem}._searchField_139de_26{width:100%}._searchSection_139de_17{flex-direction:column;align-items:stretch;gap:.5rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._button_18gkt_3{flex-shrink:0;position:relative;display:inline-flex;align-items:center;height:3.25rem;min-width:3.25rem;padding:0 .5rem}._loginButton_18gkt_13{padding:0 .75rem}._avatar_18gkt_17{font-size:2.25rem}._loginIcon_18gkt_21{width:2.25rem;height:2.25rem;background-color:#e0e2e4;border-radius:50%;color:#000;display:flex;justify-content:center;align-items:center}._label_18gkt_32{display:flex;flex-direction:column}._title_18gkt_37{font-size:1rem;line-height:1.2;font-weight:500;color:var(--ds-color-neutral-text-default)}._description_18gkt_44{font-size:.875rem;font-weight:400;color:var(--ds-color-neutral-text-subtle)}._icon_18gkt_50{display:block;font-size:1.5rem;margin:0!important}._badge_18gkt_56{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
input[type=date]::-webkit-inner-spin-button,input[type=date]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}
|
|
1
|
+
input[type=date]::-webkit-inner-spin-button,input[type=date]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}@supports (-webkit-touch-callout: none){@media(pointer:coarse){input[type=date]{height:37px;line-height:21px}}}
|
package/dist/assets/Dropdown.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._dropdown_1mtdm_1{background-color:var(--ds-color-background-default);color:var(--ds-color-text-default);box-shadow:var(--ds-shadow-sm);display:flex;flex-direction:column;row-gap:.5rem;padding:.5rem;white-space:unset}._dropdown_1mtdm_1:focus{outline:none}._content_1mtdm_17{flex-grow:1}._dropdown_1mtdm_1[data-size=sm]{--var-width: 16rem;--var-min-width: 16rem;--var-max-width: 20rem}._dropdown_1mtdm_1[data-size=md]{--var-width: 20rem;--var-min-width: 20rem;--var-max-width: 24rem}._dropdown_1mtdm_1[data-size=lg]{--var-width: 24rem;--var-min-width: 24rem;--var-max-width: 28rem}._dropdown_1mtdm_1[aria-hidden=true],._backdrop_1mtdm_47,._backdrop_1mtdm_47[aria-hidden=true]{display:none}@media(min-width:1024px){._backdrop_1mtdm_47{display:block;z-index:1;background-color:#111d4640;position:fixed;inset:0;width:100%;height:100%}}._dropdown_1mtdm_1{position:absolute;margin-top:.5rem;margin-bottom:.5rem;border-radius:.375rem}._dropdown_1mtdm_1[data-variant=dropdown] ._header_1mtdm_76,._dropdown_1mtdm_1[data-variant=dropdown] ._footer_1mtdm_77{display:none}._dropdown_1mtdm_1[data-variant=dropdown]{min-width:var(--var-min-width);max-width:var(--var-max-width);width:var(--var-width);max-height:80vh}._dropdown_1mtdm_1[data-variant=drawer]{position:fixed!important;inset:0!important;max-width:none!important;max-height:100vh!important;width:100%!important;margin-top:0;margin-bottom:0;border-radius:0;padding-top:0}@media(max-width:1023px){._dropdown_1mtdm_1[data-variant=drawer-dropdown]{position:fixed!important;inset:0!important;max-width:none!important;max-height:100vh!important;width:100%!important;margin-top:0;margin-bottom:0;border-radius:0;padding-top:0}}@media(min-width:1024px){._dropdown_1mtdm_1[data-variant=drawer-dropdown]{min-width:var(--var-min-width);max-width:var(--var-max-width);width:var(--var-width);max-height:80vh}._dropdown_1mtdm_1[data-variant=drawer-dropdown] ._header_1mtdm_76,._dropdown_1mtdm_1[data-variant=drawer-dropdown] ._footer_1mtdm_77{display:none}}._header_1mtdm_76{position:sticky;top:0;left:0;right:0;padding:1rem .5rem;display:flex;align-items:center;justify-content:space-between;background-color:var(--ds-color-background-default);border-bottom:1px solid var(--ds-color-border-subtle);z-index:999}._title_1mtdm_148{font-size:1.125rem;font-weight:500;margin:0}._footer_1mtdm_77{position:sticky;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center}._footer_1mtdm_77>*{margin:1rem auto}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_1urgv_1{z-index:1;background-color:#fff;width:100%}._container_1urgv_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_1urgv_19{display:none}._header_1urgv_1[data-current-id=menu],._header_1urgv_1[data-current-id=locale]{background-color:#fff}@media(min-width:1024px){._header_1urgv_1[data-current-id=menu] ._backdrop_1urgv_19,._header_1urgv_1[data-current-id=locale] ._backdrop_1urgv_19{display:block}}@media(max-width:1023px){._header_1urgv_1{gap:0}}._header_1urgv_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._nav_1urgv_53{position:relative;display:flex;align-items:center;justify-content:end;column-gap:.5rem}._dropdown_1urgv_63 header{display:none}._dropdown_1urgv_63[data-variant=drawer],._dropdown_1urgv_63[data-variant=drawer-dropdown]{margin-top:4.5rem}@media(min-width:1024px){._dropdown_1urgv_63[data-variant=drawer-dropdown]{margin-top:.5rem}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_1ssrq_3{flex-shrink:0;position:relative;display:flex;align-items:center;border:none;height:3.25rem;min-width:3.25rem;padding:0 .75rem}._icon_1ssrq_14{display:block;font-size:1.5rem;width:1.5rem;height:1.5rem;margin:0!important}._label_1ssrq_22{font-size:1.125rem;font-weight:500;margin-right:.25rem}._badge_1ssrq_28{position:absolute;top:-.5rem;right:-.5rem}@media(max-width:360px){._label_1ssrq_22{display:none}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._logo_1yxnd_1{display:flex;align-items:center;color:currentColor;text-decoration:none;height:3.25rem;min-width:3.25rem;padding:0 .5rem;-webkit-user-select:none;user-select:none}._logo_1yxnd_1:hover{background-color:transparent}._logomark_1yxnd_16{color:#0062b8;width:2rem;height:2rem;margin:0!important}._text_1yxnd_23{font-size:2rem;font-weight:400}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._grid_1869r_1{flex-grow:1;width:100%;max-width:1512px;padding:0 1rem;margin:0 auto;display:flex;flex-direction:column}._grid_1869r_1[data-current-id=accountFullscreen]{display:none}@media(max-width:1023px){._grid_1869r_1[data-current-id=menu]{display:none}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._modal_3d5cx_1{padding:0;width:100%;max-width:450px;border:none;background-color:#fff;border-radius:.5rem;box-shadow:var(--ds-shadow-xs)}._modal_3d5cx_1[data-backdrop-color=inherit]::backdrop{background-color:#111d4640}._modal_3d5cx_1[data-backdrop-color=transparent]::backdrop{background-color:transparent}._modal_3d5cx_1[data-variant=default]{max-width:640px;margin:auto}._modal_3d5cx_1[data-variant=content]{max-width:988px;margin:auto}._modal_3d5cx_1[data-height=full]{min-height:unset;height:100%}._modal_3d5cx_1[data-variant=full]{width:100%;max-width:none;height:100%;min-height:unset}._content_3d5cx_41{position:relative}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._footer_1rs1j_1{width:100%;padding:1.5em;display:flex;align-items:center;justify-content:space-between}._sticky_1rs1j_9{background-color:var(--ds-color-background-default);position:sticky;z-index:2;left:0;right:0;bottom:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._section_13ero_1{padding:.5rem 1rem;border-radius:.5rem}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
3
|
+
import { useState as L, useEffect as M, useMemo as S } from "react";
|
|
4
4
|
import "../../index-p1eeF8LQ.js";
|
|
5
5
|
import "../Button/Button.js";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { M as
|
|
8
|
+
import { M as F } from "../../SearchField-QTfebYdU.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
const
|
|
10
|
+
const b = (n) => `${n} hits`, G = ({
|
|
11
11
|
items: n = [],
|
|
12
|
-
groups:
|
|
12
|
+
groups: u = {},
|
|
13
13
|
search: t,
|
|
14
14
|
filterAccount: i,
|
|
15
15
|
onSelectAccount: d,
|
|
@@ -28,13 +28,13 @@ const F = (n) => `${n} hits`, G = ({
|
|
|
28
28
|
onClick: () => {
|
|
29
29
|
!e.disabled && d?.(e.id);
|
|
30
30
|
}
|
|
31
|
-
})), [o,
|
|
32
|
-
|
|
33
|
-
t?.value !== void 0 &&
|
|
31
|
+
})), [o, a] = L("");
|
|
32
|
+
M(() => {
|
|
33
|
+
t?.value !== void 0 && a(t.value);
|
|
34
34
|
}, [t?.value]);
|
|
35
|
-
const
|
|
35
|
+
const s = i || ((e, l) => e?.name?.toLowerCase().includes(l.toLowerCase()) || e?.description?.toString()?.toLowerCase().includes(l.toLowerCase()) || e?.searchWords?.some((w) => w.toLowerCase().includes(l.toLowerCase()))), r = S(() => o ? Array.from(
|
|
36
36
|
new Map(
|
|
37
|
-
c.filter((e) =>
|
|
37
|
+
c.filter((e) => s(e, o)).map((e) => [
|
|
38
38
|
e.id,
|
|
39
39
|
{
|
|
40
40
|
...e,
|
|
@@ -44,27 +44,27 @@ const F = (n) => `${n} hits`, G = ({
|
|
|
44
44
|
}
|
|
45
45
|
])
|
|
46
46
|
).values()
|
|
47
|
-
) : c, [c, o,
|
|
47
|
+
) : c, [c, o, s]), v = o ? {
|
|
48
48
|
search: {
|
|
49
|
-
title: t?.getResultsLabel?.(r.length) ??
|
|
49
|
+
title: t?.getResultsLabel?.(r.length) ?? b(r.length)
|
|
50
50
|
}
|
|
51
|
-
} :
|
|
51
|
+
} : u, C = {
|
|
52
52
|
name: "account-search",
|
|
53
53
|
value: o,
|
|
54
54
|
placeholder: t?.placeholder ?? "Find account",
|
|
55
|
-
onChange: (e) =>
|
|
56
|
-
onClear: () =>
|
|
57
|
-
},
|
|
55
|
+
onChange: (e) => a(e.target.value),
|
|
56
|
+
onClear: () => a("")
|
|
57
|
+
}, m = [
|
|
58
58
|
...r.length > 0 ? r : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
59
59
|
];
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
|
|
60
|
+
return /* @__PURE__ */ A(
|
|
61
|
+
F,
|
|
62
62
|
{
|
|
63
63
|
variant: "default",
|
|
64
64
|
size: "md",
|
|
65
|
-
search: t && !t.hidden ?
|
|
65
|
+
search: t && !t.hidden ? C : void 0,
|
|
66
66
|
groups: v,
|
|
67
|
-
items:
|
|
67
|
+
items: m,
|
|
68
68
|
virtualized: f,
|
|
69
69
|
keyboardEvents: g,
|
|
70
70
|
scrollRefStyles: h
|
|
@@ -1,18 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as p, createElement as f } from "react";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
|
+
import { useMenu as u } from "../../hooks/useMenu.js";
|
|
5
|
+
import { Heading as h } from "../Typography/Heading.js";
|
|
4
6
|
import "../Button/Button.js";
|
|
5
|
-
import { BookmarkSettingsItem as
|
|
7
|
+
import { BookmarkSettingsItem as k } from "./BookmarkSettingsItem.js";
|
|
6
8
|
import "react-dom";
|
|
7
9
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { Divider as
|
|
9
|
-
import { List as
|
|
10
|
+
import { Divider as y } from "../Divider/Divider.js";
|
|
11
|
+
import { List as S } from "../List/List.js";
|
|
10
12
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import { Flex as v } from "../Page/Flex.js";
|
|
14
|
+
import { SettingsSection as B } from "../Settings/SettingsSection.js";
|
|
15
|
+
const w = ({ loading: s, items: t, groups: l = {}, sortGroupBy: a }) => {
|
|
16
|
+
if (!t || t.length < 1)
|
|
17
|
+
return null;
|
|
18
|
+
const { menu: c } = u({
|
|
19
|
+
items: t,
|
|
20
|
+
groups: l,
|
|
21
|
+
groupByKey: "groupId",
|
|
22
|
+
keyboardEvents: !1,
|
|
23
|
+
sortGroupBy: a
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ r(v, { as: "div", spacing: "page", direction: "col", children: c?.map((i, g) => {
|
|
26
|
+
const e = i.props || {};
|
|
27
|
+
return /* @__PURE__ */ n(p, { children: [
|
|
28
|
+
e?.title && /* @__PURE__ */ r(h, { size: "lg", children: e.title }),
|
|
29
|
+
/* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(S, { size: "sm", children: i?.items.map((d, o) => {
|
|
30
|
+
const m = d.props || {};
|
|
31
|
+
return /* @__PURE__ */ n(p, { children: [
|
|
32
|
+
o > 0 && /* @__PURE__ */ r(y, { as: "li" }),
|
|
33
|
+
/* @__PURE__ */ f(
|
|
34
|
+
k,
|
|
35
|
+
{
|
|
36
|
+
...m,
|
|
37
|
+
key: "settings-list-item" + o,
|
|
38
|
+
loading: s || m?.loading
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }, o);
|
|
42
|
+
}) }) })
|
|
43
|
+
] }, g);
|
|
44
|
+
}) });
|
|
45
|
+
};
|
|
16
46
|
export {
|
|
17
|
-
|
|
47
|
+
w as BookmarkSettingsList
|
|
18
48
|
};
|
|
@@ -6,7 +6,7 @@ import { Button as H } from "../Button/Button.js";
|
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
8
|
import { S as Q } from "../../XMark-tKk6aExO.js";
|
|
9
|
-
import '../../assets/Dropdown.css';const V = "
|
|
9
|
+
import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_1mtdm_17", P = "_backdrop_1mtdm_47", tt = "_header_1mtdm_76", et = "_footer_1mtdm_77", rt = "_title_1mtdm_148", m = {
|
|
10
10
|
dropdown: V,
|
|
11
11
|
content: Z,
|
|
12
12
|
backdrop: P,
|
|
@@ -42,7 +42,7 @@ import '../../assets/Dropdown.css';const V = "_dropdown_15prw_1", Z = "_content_
|
|
|
42
42
|
trigger: N,
|
|
43
43
|
children: B,
|
|
44
44
|
open: r,
|
|
45
|
-
onClose:
|
|
45
|
+
onClose: g,
|
|
46
46
|
onSubmit: I,
|
|
47
47
|
activeDescendantId: T,
|
|
48
48
|
useFixedPosition: l = !1
|
|
@@ -57,7 +57,7 @@ import '../../assets/Dropdown.css';const V = "_dropdown_15prw_1", Z = "_content_
|
|
|
57
57
|
maxHeight: 300
|
|
58
58
|
}), f = $(() => {
|
|
59
59
|
if (r && b.current && u.current) {
|
|
60
|
-
const t = b.current.getBoundingClientRect(), s = u.current.getBoundingClientRect(), o = window.innerHeight, e = window.innerWidth, i = 16, d = o - t.bottom,
|
|
60
|
+
const t = b.current.getBoundingClientRect(), s = u.current.getBoundingClientRect(), o = window.innerHeight, e = window.innerWidth, i = 16, d = o - t.bottom, w = t.top, y = e - t.right - s.width, A = d < 250 && w > d, j = A ? "top" : "bottom", q = (A ? w : d) - i, K = y < i ? "right" : "left";
|
|
61
61
|
X((U) => ({
|
|
62
62
|
...U,
|
|
63
63
|
yDir: j,
|
|
@@ -91,15 +91,15 @@ import '../../assets/Dropdown.css';const V = "_dropdown_15prw_1", Z = "_content_
|
|
|
91
91
|
return () => cancelAnimationFrame(t);
|
|
92
92
|
}, [r]), D(() => {
|
|
93
93
|
const t = (o) => {
|
|
94
|
-
o.key === "Escape" &&
|
|
94
|
+
o.key === "Escape" && g();
|
|
95
95
|
}, s = (o) => {
|
|
96
96
|
const e = o.target, i = b.current?.contains(e), d = u.current?.contains(e);
|
|
97
|
-
!i && !d &&
|
|
97
|
+
!i && !d && g();
|
|
98
98
|
};
|
|
99
99
|
return r && (document.addEventListener("mousedown", s), document.addEventListener("keydown", t)), () => {
|
|
100
100
|
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", t);
|
|
101
101
|
};
|
|
102
|
-
}, [r,
|
|
102
|
+
}, [r, g]), D(() => {
|
|
103
103
|
if (!r) return;
|
|
104
104
|
const t = u.current;
|
|
105
105
|
if (!t) return;
|
|
@@ -115,8 +115,8 @@ import '../../assets/Dropdown.css';const V = "_dropdown_15prw_1", Z = "_content_
|
|
|
115
115
|
e.preventDefault(), t.focus?.({ preventScroll: !0 });
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
const d = i[0],
|
|
119
|
-
e.shiftKey ? y === d && (e.preventDefault(),
|
|
118
|
+
const d = i[0], w = i[i.length - 1], y = document.activeElement;
|
|
119
|
+
e.shiftKey ? y === d && (e.preventDefault(), w.focus({ preventScroll: !0 })) : y === w && (e.preventDefault(), d.focus({ preventScroll: !0 }));
|
|
120
120
|
};
|
|
121
121
|
return document.addEventListener("focusin", s), document.addEventListener("keydown", o), () => {
|
|
122
122
|
document.removeEventListener("focusin", s), document.removeEventListener("keydown", o);
|
|
@@ -154,10 +154,10 @@ import '../../assets/Dropdown.css';const V = "_dropdown_15prw_1", Z = "_content_
|
|
|
154
154
|
children: [
|
|
155
155
|
/* @__PURE__ */ x("header", { className: m.header, children: [
|
|
156
156
|
/* @__PURE__ */ a("h2", { className: m.title, children: C }),
|
|
157
|
-
/* @__PURE__ */ a(H, { size: "sm", variant: "outline", onClick:
|
|
157
|
+
/* @__PURE__ */ a(H, { size: "sm", variant: "outline", onClick: g, "aria-label": F, children: /* @__PURE__ */ a(Q, {}) })
|
|
158
158
|
] }),
|
|
159
159
|
/* @__PURE__ */ a("div", { className: m.content, children: B }),
|
|
160
|
-
k && /* @__PURE__ */ a("footer", { className: m.footer, children: /* @__PURE__ */ a(H, { size: "lg", variant: "solid", onClick: I ||
|
|
160
|
+
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
161
|
]
|
|
162
162
|
}
|
|
163
163
|
);
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { A as o } from "../../alert-BzifOfXl.js";
|
|
2
|
-
import { B as
|
|
3
|
-
import { B as
|
|
4
|
-
import { H as
|
|
5
|
-
import { D as
|
|
6
|
-
import { P as
|
|
7
|
-
import {
|
|
8
|
-
import { V as w } from "../../index-z82sbSVU.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, S as d, f as S, g as l, T as P, u as b } from "../../textfield-CNXt-27J.js";
|
|
3
|
+
import { B as c, S as B } from "../../button-BB5sYVKY.js";
|
|
4
|
+
import { H as L, S as k } from "../../switch-Cemfhx0H.js";
|
|
5
|
+
import { D as T } from "../../index-Q0EA2XB0.js";
|
|
6
|
+
import { P as H } from "../../paragraph-BRiIBpbY.js";
|
|
7
|
+
import { V as v } from "../../index-z82sbSVU.js";
|
|
9
8
|
export {
|
|
10
9
|
o as DsAlert,
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
e as DsBadge,
|
|
11
|
+
c as DsButton,
|
|
13
12
|
r as DsCheckbox,
|
|
14
13
|
t as DsChip,
|
|
15
14
|
i as DsCombobox,
|
|
16
|
-
|
|
15
|
+
T as DsDetails,
|
|
17
16
|
n as DsDialog,
|
|
18
|
-
|
|
17
|
+
L as DsHeading,
|
|
19
18
|
p as DsLink,
|
|
20
19
|
x as DsListItem,
|
|
21
20
|
f as DsListUnordered,
|
|
22
21
|
m as DsPagination,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
H as DsParagraph,
|
|
23
|
+
g as DsPopover,
|
|
24
|
+
d as DsSearch,
|
|
25
|
+
S as DsSkeleton,
|
|
26
|
+
B as DsSpinner,
|
|
27
|
+
k as DsSwitch,
|
|
28
|
+
l as DsTabs,
|
|
29
|
+
P as DsTextfield,
|
|
30
|
+
v as DsValidationMessage,
|
|
31
|
+
b as useDsPagination
|
|
33
32
|
};
|
|
@@ -1,138 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { AccountMenu as L } from "../Account/AccountMenu.js";
|
|
7
|
-
import { Button as A } from "../Button/Button.js";
|
|
1
|
+
import { jsx as c, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../index-p1eeF8LQ.js";
|
|
3
|
+
import { useState as _, useEffect as g } from "react";
|
|
4
|
+
import { AccountMenu as w } from "../Account/AccountMenu.js";
|
|
5
|
+
import "../Button/Button.js";
|
|
8
6
|
import "react-dom";
|
|
9
|
-
import { useRootContext as
|
|
7
|
+
import { useRootContext as N } from "../RootProvider/RootProvider.js";
|
|
10
8
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { S as
|
|
12
|
-
import { S as
|
|
13
|
-
import { H as
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
const D = z((e, l) => {
|
|
24
|
-
var { title: n, titleId: t } = e, r = $(e, ["title", "titleId"]);
|
|
25
|
-
let c = j();
|
|
26
|
-
return c = n ? t || "title-" + c : void 0, u.createElement(
|
|
27
|
-
"svg",
|
|
28
|
-
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: l, "aria-labelledby": c }, r),
|
|
29
|
-
n ? u.createElement("title", { id: c }, n) : null,
|
|
30
|
-
u.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m4.03 9.28-3.5 3.5a.75.75 0 0 1-1.06 0l-3.5-3.5a.75.75 0 0 1 .53-1.28h7a.75.75 0 0 1 .53 1.28m-2.34.22h-3.38L12 13.44z", clipRule: "evenodd" })
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
var K = function(e, l) {
|
|
34
|
-
var n = {};
|
|
35
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (n[t] = e[t]);
|
|
36
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
37
|
-
for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
|
|
38
|
-
l.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
|
|
39
|
-
return n;
|
|
40
|
-
};
|
|
41
|
-
const W = z((e, l) => {
|
|
42
|
-
var { title: n, titleId: t } = e, r = K(e, ["title", "titleId"]);
|
|
43
|
-
let c = j();
|
|
44
|
-
return c = n ? t || "title-" + c : void 0, u.createElement(
|
|
45
|
-
"svg",
|
|
46
|
-
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: l, "aria-labelledby": c }, r),
|
|
47
|
-
n ? u.createElement("title", { id: c }, n) : null,
|
|
48
|
-
u.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m.53 6.72a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 .53 1.28h7a.75.75 0 0 0 .53-1.28zM12 10.56l1.69 1.69h-3.38z", clipRule: "evenodd" })
|
|
49
|
-
);
|
|
50
|
-
}), q = "_accountSelector_lyp2e_1", G = "_heading_lyp2e_11", J = "_searchSection_lyp2e_17", Q = "_searchField_lyp2e_26", U = "_accountMenu_lyp2e_30", X = "_fullScreen_lyp2e_38", Y = "_virtualized_lyp2e_42", Z = "_btnIcon_lyp2e_46", ee = "_spinner_lyp2e_50", i = {
|
|
51
|
-
accountSelector: q,
|
|
52
|
-
heading: G,
|
|
53
|
-
searchSection: J,
|
|
54
|
-
searchField: Q,
|
|
55
|
-
accountMenu: U,
|
|
56
|
-
fullScreen: X,
|
|
57
|
-
virtualized: Y,
|
|
58
|
-
btnIcon: Z,
|
|
59
|
-
spinner: ee
|
|
60
|
-
}, ge = ({
|
|
9
|
+
import { S as A } from "../../SearchField-QTfebYdU.js";
|
|
10
|
+
import { S as L } from "../../button-BB5sYVKY.js";
|
|
11
|
+
import { H as M, S as F } from "../../switch-Cemfhx0H.js";
|
|
12
|
+
import '../../assets/AccountSelector.css';const T = "_accountSelector_139de_1", j = "_heading_139de_11", C = "_searchSection_139de_17", H = "_searchField_139de_26", V = "_accountMenu_139de_30", y = "_virtualized_139de_38", E = "_spinner_139de_47", r = {
|
|
13
|
+
accountSelector: T,
|
|
14
|
+
heading: j,
|
|
15
|
+
searchSection: C,
|
|
16
|
+
searchField: H,
|
|
17
|
+
accountMenu: V,
|
|
18
|
+
virtualized: y,
|
|
19
|
+
spinner: E
|
|
20
|
+
}, Z = ({
|
|
61
21
|
accountMenu: e,
|
|
62
|
-
forceOpenFullScreen:
|
|
63
|
-
className:
|
|
64
|
-
loading:
|
|
65
|
-
showDeletedUnits:
|
|
66
|
-
onShowDeletedUnitsChange:
|
|
22
|
+
forceOpenFullScreen: t,
|
|
23
|
+
className: i,
|
|
24
|
+
loading: v,
|
|
25
|
+
showDeletedUnits: s,
|
|
26
|
+
onShowDeletedUnitsChange: x
|
|
67
27
|
}) => {
|
|
68
|
-
const {
|
|
69
|
-
|
|
70
|
-
!
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
const {
|
|
75
|
-
|
|
76
|
-
}, N = (s) => {
|
|
77
|
-
e.onSelectAccount?.(s), g(), b(!1);
|
|
28
|
+
const { openId: o, closeAll: l, languageCode: d } = N(), [u, h] = _(""), [a, m] = _(t);
|
|
29
|
+
g(() => {
|
|
30
|
+
!t && a && l(), m(t);
|
|
31
|
+
}, [t]), g(() => {
|
|
32
|
+
a === !0 && o("account");
|
|
33
|
+
}, [a, o]);
|
|
34
|
+
const { searchText: S, heading: z, switchLabel: b } = I(d), k = (n) => {
|
|
35
|
+
e.onSelectAccount?.(n), l(), m(!1);
|
|
78
36
|
};
|
|
79
|
-
return
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
37
|
+
return v ? /* @__PURE__ */ c(L, { "aria-hidden": !0, "data-color": "neutral", className: r.spinner }) : /* @__PURE__ */ f("div", { className: p(i, r.accountSelector), children: [
|
|
38
|
+
/* @__PURE__ */ c(M, { "data-size": "sm", level: 2, className: r.heading, children: z }),
|
|
39
|
+
/* @__PURE__ */ f("div", { className: r.searchSection, children: [
|
|
40
|
+
/* @__PURE__ */ c(
|
|
41
|
+
A,
|
|
84
42
|
{
|
|
85
|
-
name:
|
|
86
|
-
placeholder:
|
|
87
|
-
value:
|
|
88
|
-
onChange: (
|
|
89
|
-
onClear: () =>
|
|
90
|
-
className:
|
|
43
|
+
name: S,
|
|
44
|
+
placeholder: S,
|
|
45
|
+
value: u,
|
|
46
|
+
onChange: (n) => h(n.target.value),
|
|
47
|
+
onClear: () => h(""),
|
|
48
|
+
className: r.searchField
|
|
91
49
|
}
|
|
92
50
|
),
|
|
93
|
-
|
|
94
|
-
|
|
51
|
+
s !== void 0 && /* @__PURE__ */ c(
|
|
52
|
+
F,
|
|
95
53
|
{
|
|
96
|
-
checked:
|
|
97
|
-
onChange: (
|
|
98
|
-
label:
|
|
54
|
+
checked: s,
|
|
55
|
+
onChange: (n) => x?.(n.target.checked),
|
|
56
|
+
label: b
|
|
99
57
|
}
|
|
100
58
|
)
|
|
101
59
|
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
60
|
+
/* @__PURE__ */ c("div", { className: p(r.accountMenu, e.virtualized && r.virtualized), children: /* @__PURE__ */ c(
|
|
61
|
+
w,
|
|
104
62
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
onSelectAccount: N,
|
|
115
|
-
keyboardEvents: !1,
|
|
116
|
-
search: {
|
|
117
|
-
hidden: !0,
|
|
118
|
-
name: "",
|
|
119
|
-
value: S,
|
|
120
|
-
getResultsLabel: (s) => ne(s, v)
|
|
121
|
-
},
|
|
122
|
-
scrollRefStyles: !o && e.virtualized ? { maxHeight: "calc(40vh)" } : void 0
|
|
123
|
-
}
|
|
124
|
-
)
|
|
63
|
+
...e,
|
|
64
|
+
onSelectAccount: k,
|
|
65
|
+
keyboardEvents: !1,
|
|
66
|
+
search: {
|
|
67
|
+
hidden: !0,
|
|
68
|
+
name: "",
|
|
69
|
+
value: u,
|
|
70
|
+
getResultsLabel: (n) => R(n, d)
|
|
71
|
+
}
|
|
125
72
|
}
|
|
126
|
-
)
|
|
127
|
-
f !== !0 && p && /* @__PURE__ */ a(A, { variant: "ghost", onClick: M, children: o ? /* @__PURE__ */ m(w, { children: [
|
|
128
|
-
/* @__PURE__ */ a(W, { className: i.btnIcon, "aria-hidden": "true" }),
|
|
129
|
-
k
|
|
130
|
-
] }) : /* @__PURE__ */ m(w, { children: [
|
|
131
|
-
/* @__PURE__ */ a(D, { className: i.btnIcon, "aria-hidden": "true" }),
|
|
132
|
-
C
|
|
133
|
-
] }) })
|
|
73
|
+
) })
|
|
134
74
|
] });
|
|
135
|
-
},
|
|
75
|
+
}, I = (e) => {
|
|
136
76
|
switch (e) {
|
|
137
77
|
case "nn":
|
|
138
78
|
return {
|
|
@@ -159,10 +99,10 @@ const W = z((e, l) => {
|
|
|
159
99
|
switchLabel: "Vis slettede"
|
|
160
100
|
};
|
|
161
101
|
}
|
|
162
|
-
},
|
|
163
|
-
const
|
|
164
|
-
return e === 0 ?
|
|
102
|
+
}, R = (e, t) => {
|
|
103
|
+
const i = t === "nb" || t === "nn";
|
|
104
|
+
return e === 0 ? i ? "Ingen treff" : "No hits" : i ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
|
|
165
105
|
};
|
|
166
106
|
export {
|
|
167
|
-
|
|
107
|
+
Z as AccountSelector
|
|
168
108
|
};
|