@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 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";
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 H } from "../../button-BB5sYVKY.js";
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 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,
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: M
20
+ spinner: R
21
21
  }, D = ({
22
22
  accountMenu: e,
23
23
  forceOpenFullScreen: r,
24
- className: n,
24
+ className: a,
25
25
  loading: p,
26
26
  showDeletedUnits: s,
27
- onShowDeletedUnitsChange: v,
28
- isFullScreen: i
27
+ onShowDeletedUnitsChange: _,
28
+ isFullScreen: g
29
29
  }) => {
30
- const { closeAll: o, languageCode: l } = k(), [d, h] = g(""), [_, u] = g(r);
30
+ const { closeAll: i, languageCode: o } = k(), [l, d] = f(""), [v, h] = f(r);
31
31
  z(() => {
32
- !r && _ && o(), u(r);
32
+ !r && v && i(), h(r);
33
33
  }, [r]);
34
- const { searchText: m, heading: w, switchLabel: x } = V(l), b = (c) => {
35
- e.onSelectAccount?.(c), o(), u(!1);
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__ */ 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(
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: m,
45
- placeholder: m,
46
- value: d,
47
- onChange: (c) => h(c.target.value),
48
- onClear: () => h(""),
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__ */ a(
52
+ s !== void 0 && /* @__PURE__ */ c(
53
53
  A,
54
54
  {
55
55
  size: "sm",
56
56
  checked: s,
57
- onChange: (c) => v?.(c.target.checked),
57
+ onChange: (n) => _?.(n.target.checked),
58
58
  label: x
59
59
  }
60
60
  )
61
61
  ] }),
62
- /* @__PURE__ */ a(
62
+ /* @__PURE__ */ c(
63
63
  "div",
64
64
  {
65
- className: f(
65
+ className: S(
66
66
  t.accountMenu,
67
- i && t.fullScreen,
67
+ g && t.fullScreen,
68
68
  e.virtualized && t.virtualized
69
69
  ),
70
- children: /* @__PURE__ */ a(
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: d,
80
- getResultsLabel: (c) => $(c, l)
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 n = r === "nb" || r === "nn";
111
- return e === 0 ? n ? "Ingen treff" : "No hits" : n ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.56.30",
3
+ "version": "0.56.32",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",