@altinn/altinn-components 0.56.30 → 0.56.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsx as c, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as S } from "../../index-p1eeF8LQ.js";
|
|
3
|
+
import { useState as f, useEffect as z } from "react";
|
|
4
4
|
import { AccountMenu as N } from "../Account/AccountMenu.js";
|
|
5
5
|
import "../Button/Button.js";
|
|
6
6
|
import "react-dom";
|
|
@@ -8,66 +8,66 @@ import { useRootContext as k } from "../RootProvider/RootProvider.js";
|
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
9
|
import { Switch as A } from "../Forms/Switch.js";
|
|
10
10
|
import { S as L } from "../../SearchField-QTfebYdU.js";
|
|
11
|
-
import { S as
|
|
11
|
+
import { S as F } from "../../button-BB5sYVKY.js";
|
|
12
12
|
import { H as T } from "../../heading-C_XYsUfi.js";
|
|
13
|
-
import '../../assets/AccountSelector.css';const
|
|
14
|
-
accountSelector:
|
|
15
|
-
heading:
|
|
16
|
-
searchSection:
|
|
17
|
-
searchField:
|
|
13
|
+
import '../../assets/AccountSelector.css';const C = "_accountSelector_829wd_1", H = "_heading_829wd_11", y = "_searchSection_829wd_17", M = "_searchField_829wd_30", j = "_accountMenu_829wd_34", E = "_virtualized_829wd_43", R = "_spinner_829wd_58", t = {
|
|
14
|
+
accountSelector: C,
|
|
15
|
+
heading: H,
|
|
16
|
+
searchSection: y,
|
|
17
|
+
searchField: M,
|
|
18
18
|
accountMenu: j,
|
|
19
19
|
virtualized: E,
|
|
20
|
-
spinner:
|
|
20
|
+
spinner: R
|
|
21
21
|
}, D = ({
|
|
22
22
|
accountMenu: e,
|
|
23
23
|
forceOpenFullScreen: r,
|
|
24
|
-
className:
|
|
24
|
+
className: a,
|
|
25
25
|
loading: p,
|
|
26
26
|
showDeletedUnits: s,
|
|
27
|
-
onShowDeletedUnitsChange:
|
|
28
|
-
isFullScreen:
|
|
27
|
+
onShowDeletedUnitsChange: _,
|
|
28
|
+
isFullScreen: g
|
|
29
29
|
}) => {
|
|
30
|
-
const { closeAll:
|
|
30
|
+
const { closeAll: i, languageCode: o } = k(), [l, d] = f(""), [v, h] = f(r);
|
|
31
31
|
z(() => {
|
|
32
|
-
!r &&
|
|
32
|
+
!r && v && i(), h(r);
|
|
33
33
|
}, [r]);
|
|
34
|
-
const { searchText:
|
|
35
|
-
e.onSelectAccount?.(
|
|
34
|
+
const { searchText: u, heading: w, switchLabel: x } = V(o), b = (n) => {
|
|
35
|
+
e.onSelectAccount?.(n), i(), h(!1);
|
|
36
36
|
};
|
|
37
|
-
return p ? /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
37
|
+
return p ? /* @__PURE__ */ c(F, { "aria-hidden": !0, "data-color": "neutral", className: t.spinner }) : /* @__PURE__ */ m("div", { className: S(a, t.accountSelector), children: [
|
|
38
|
+
/* @__PURE__ */ c(T, { "data-size": "sm", level: 2, className: t.heading, children: w }),
|
|
39
|
+
/* @__PURE__ */ m("div", { className: t.searchSection, children: [
|
|
40
|
+
/* @__PURE__ */ c(
|
|
41
41
|
L,
|
|
42
42
|
{
|
|
43
43
|
size: "sm",
|
|
44
|
-
name:
|
|
45
|
-
placeholder:
|
|
46
|
-
value:
|
|
47
|
-
onChange: (
|
|
48
|
-
onClear: () =>
|
|
44
|
+
name: u,
|
|
45
|
+
placeholder: u,
|
|
46
|
+
value: l,
|
|
47
|
+
onChange: (n) => d(n.target.value),
|
|
48
|
+
onClear: () => d(""),
|
|
49
49
|
className: t.searchField
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
s !== void 0 && /* @__PURE__ */
|
|
52
|
+
s !== void 0 && /* @__PURE__ */ c(
|
|
53
53
|
A,
|
|
54
54
|
{
|
|
55
55
|
size: "sm",
|
|
56
56
|
checked: s,
|
|
57
|
-
onChange: (
|
|
57
|
+
onChange: (n) => _?.(n.target.checked),
|
|
58
58
|
label: x
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
] }),
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ c(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
className:
|
|
65
|
+
className: S(
|
|
66
66
|
t.accountMenu,
|
|
67
|
-
|
|
67
|
+
g && t.fullScreen,
|
|
68
68
|
e.virtualized && t.virtualized
|
|
69
69
|
),
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ c(
|
|
71
71
|
N,
|
|
72
72
|
{
|
|
73
73
|
...e,
|
|
@@ -76,10 +76,9 @@ import '../../assets/AccountSelector.css';const y = "_accountSelector_829wd_1",
|
|
|
76
76
|
search: {
|
|
77
77
|
hidden: !0,
|
|
78
78
|
name: "",
|
|
79
|
-
value:
|
|
80
|
-
getResultsLabel: (
|
|
81
|
-
}
|
|
82
|
-
scrollRefStyles: !i && e.virtualized ? { maxHeight: "calc(40vh)" } : void 0
|
|
79
|
+
value: l,
|
|
80
|
+
getResultsLabel: (n) => $(n, o)
|
|
81
|
+
}
|
|
83
82
|
}
|
|
84
83
|
)
|
|
85
84
|
}
|
|
@@ -107,8 +106,8 @@ import '../../assets/AccountSelector.css';const y = "_accountSelector_829wd_1",
|
|
|
107
106
|
};
|
|
108
107
|
}
|
|
109
108
|
}, $ = (e, r) => {
|
|
110
|
-
const
|
|
111
|
-
return e === 0 ?
|
|
109
|
+
const a = r === "nb" || r === "nn";
|
|
110
|
+
return e === 0 ? a ? "Ingen treff" : "No hits" : a ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
|
|
112
111
|
};
|
|
113
112
|
export {
|
|
114
113
|
D as AccountSelector
|