@altinn/altinn-components 0.50.0 → 0.50.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/components/GlobalHeader/DigdirLogomark.js +5 -4
- package/dist/components/GlobalHeader/HeaderLogo.js +4 -4
- package/dist/components/Header/DigdirLogomark.js +1 -1
- package/dist/hooks/useAccountSelector.js +30 -31
- package/dist/types/lib/components/Header/HeaderLogo.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as e, jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import { useIsDesktop as r } from "../../hooks/useIsDesktop.js";
|
|
3
|
-
const
|
|
3
|
+
const a = ({ className: i, title: L = "Digdir logo", "aria-hidden": o }) => {
|
|
4
4
|
const l = r() ? 8.5 : 7, { width: t, height: n } = { width: `${l}em`, height: `${l * 0.34}em` };
|
|
5
5
|
return /* @__PURE__ */ e(
|
|
6
6
|
"svg",
|
|
@@ -11,10 +11,11 @@ const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) =>
|
|
|
11
11
|
height: n,
|
|
12
12
|
viewBox: "0 0 113.779 38.8565",
|
|
13
13
|
version: "1.1",
|
|
14
|
-
className:
|
|
14
|
+
className: i,
|
|
15
15
|
"aria-hidden": o,
|
|
16
|
+
"aria-labelledby": "digdir-logo-title",
|
|
16
17
|
children: [
|
|
17
|
-
/* @__PURE__ */ C("title", { children:
|
|
18
|
+
/* @__PURE__ */ C("title", { id: "digdir-logo-title", children: L }),
|
|
18
19
|
/* @__PURE__ */ e("g", { id: "surface1", children: [
|
|
19
20
|
/* @__PURE__ */ C(
|
|
20
21
|
"path",
|
|
@@ -106,5 +107,5 @@ const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) =>
|
|
|
106
107
|
);
|
|
107
108
|
};
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
a as DigdirLogomark
|
|
110
111
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import { Badge as g } from "../Badge/Badge.js";
|
|
4
4
|
import { ButtonBase as l } from "../Button/ButtonBase.js";
|
|
5
5
|
import "react";
|
|
@@ -13,8 +13,8 @@ import '../../assets/HeaderLogo2.css';const f = "_logo_1d6ig_1", d = {
|
|
|
13
13
|
en: "Go to homepage"
|
|
14
14
|
}, C = ({ className: r, as: m = "a", href: s = "/", badge: o }) => {
|
|
15
15
|
const { languageCode: e } = c(), i = x[e ?? ""] ?? "Gå til forsiden";
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */ t(p, {}),
|
|
16
|
+
return /* @__PURE__ */ n(l, { as: m, className: a(d.logo, r), href: s, children: [
|
|
17
|
+
/* @__PURE__ */ t(p, { title: i }),
|
|
18
18
|
o && /* @__PURE__ */ t(g, { ...o })
|
|
19
19
|
] });
|
|
20
20
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as W } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as Y } from "react";
|
|
3
3
|
import "../index-L8X2o7IH.js";
|
|
4
|
-
import { IconButton as
|
|
4
|
+
import { IconButton as q } from "../components/Button/IconButton.js";
|
|
5
5
|
import "../components/RootProvider/RootProvider.js";
|
|
6
|
-
import { useIsDesktop as
|
|
6
|
+
import { useIsDesktop as J } from "./useIsDesktop.js";
|
|
7
7
|
import "../components/Snackbar/useSnackbar.js";
|
|
8
8
|
import { formatDisplayName as S } from "../functions/name/name.js";
|
|
9
|
-
import { formatDate as
|
|
9
|
+
import { formatDate as K } from "../functions/date/date.js";
|
|
10
10
|
import { S as Q, a as X } from "../HeartFill-CYSrJ_xK.js";
|
|
11
11
|
const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
12
12
|
partyListDTO: t = [],
|
|
@@ -14,12 +14,12 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
14
14
|
currentAccountUuid: f,
|
|
15
15
|
selfAccountUuid: m,
|
|
16
16
|
isLoading: d = !1,
|
|
17
|
-
onSelectAccount:
|
|
17
|
+
onSelectAccount: v,
|
|
18
18
|
isVirtualized: h = !1,
|
|
19
19
|
onToggleFavorite: s,
|
|
20
20
|
languageCode: r
|
|
21
21
|
}) => {
|
|
22
|
-
const i =
|
|
22
|
+
const i = J(), [c, _, b] = Y(() => {
|
|
23
23
|
var A, N;
|
|
24
24
|
if (d || !t || !m)
|
|
25
25
|
return [[], {}, void 0];
|
|
@@ -46,7 +46,7 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
46
46
|
s,
|
|
47
47
|
i
|
|
48
48
|
)
|
|
49
|
-
),
|
|
49
|
+
), l = [];
|
|
50
50
|
for (const e of j) {
|
|
51
51
|
const u = g(
|
|
52
52
|
r,
|
|
@@ -57,10 +57,10 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
57
57
|
s,
|
|
58
58
|
i
|
|
59
59
|
);
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
for (const $ of
|
|
63
|
-
const
|
|
60
|
+
if (l.push(u), e.subunits && e.subunits.length > 0) {
|
|
61
|
+
const R = [...e.subunits].sort(z);
|
|
62
|
+
for (const $ of R) {
|
|
63
|
+
const U = g(
|
|
64
64
|
r,
|
|
65
65
|
$,
|
|
66
66
|
e.partyUuid,
|
|
@@ -70,12 +70,12 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
70
70
|
i,
|
|
71
71
|
e
|
|
72
72
|
);
|
|
73
|
-
|
|
73
|
+
l.push(U);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
const M = k.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), V =
|
|
78
|
-
[((A =
|
|
77
|
+
const M = k.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), V = l.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), w = [...M, ...V], x = [H, ...w, ...k, ...l], G = x.find((e) => (e == null ? void 0 : e.selected) === !0), E = {
|
|
78
|
+
[((A = l[0]) == null ? void 0 : A.groupId) || "company"]: {
|
|
79
79
|
title: a.account_orgs,
|
|
80
80
|
divider: !0
|
|
81
81
|
},
|
|
@@ -99,7 +99,7 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
99
99
|
r,
|
|
100
100
|
i
|
|
101
101
|
]);
|
|
102
|
-
return d || !t || !
|
|
102
|
+
return d || !t || !b ? {
|
|
103
103
|
accountMenu: {
|
|
104
104
|
items: [],
|
|
105
105
|
groups: {},
|
|
@@ -112,18 +112,18 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
112
112
|
} : {
|
|
113
113
|
accountMenu: {
|
|
114
114
|
items: c,
|
|
115
|
-
groups:
|
|
115
|
+
groups: _,
|
|
116
116
|
isVirtualized: h,
|
|
117
|
-
onSelectAccount:
|
|
118
|
-
currentAccount:
|
|
117
|
+
onSelectAccount: v,
|
|
118
|
+
currentAccount: b
|
|
119
119
|
},
|
|
120
120
|
loading: !1
|
|
121
121
|
};
|
|
122
|
-
}, g = (t, o, f, m, d,
|
|
123
|
-
const i = O((o == null ? void 0 : o.type) ?? ""), c = F(t),
|
|
122
|
+
}, g = (t, o, f, m, d, v, h, s, r) => {
|
|
123
|
+
const i = O((o == null ? void 0 : o.type) ?? ""), c = F(t), _ = S({
|
|
124
124
|
fullName: o == null ? void 0 : o.name,
|
|
125
125
|
type: i
|
|
126
|
-
}),
|
|
126
|
+
}), b = s ? S({
|
|
127
127
|
fullName: s == null ? void 0 : s.name,
|
|
128
128
|
type: O((s == null ? void 0 : s.type) ?? ""),
|
|
129
129
|
reverseNameOrder: !1
|
|
@@ -135,10 +135,10 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
135
135
|
n = `${c.org_no}: ${o.organizationNumber}`;
|
|
136
136
|
break;
|
|
137
137
|
case "person":
|
|
138
|
-
n = o != null && o.dateOfBirth ? `${c.birthdate}: ${
|
|
138
|
+
n = o != null && o.dateOfBirth ? `${c.birthdate}: ${K(o == null ? void 0 : o.dateOfBirth)}` : "";
|
|
139
139
|
break;
|
|
140
140
|
case "subunit":
|
|
141
|
-
n = `↳ ${c.org_no}: ${o == null ? void 0 : o.organizationNumber}, ${c.subunit_of} ${
|
|
141
|
+
n = `↳ ${c.org_no}: ${o == null ? void 0 : o.organizationNumber}, ${c.subunit_of} ${b}`;
|
|
142
142
|
break;
|
|
143
143
|
default:
|
|
144
144
|
n = "";
|
|
@@ -146,28 +146,27 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
|
|
|
146
146
|
return {
|
|
147
147
|
id: o == null ? void 0 : o.partyUuid,
|
|
148
148
|
icon: {
|
|
149
|
-
name:
|
|
149
|
+
name: _,
|
|
150
150
|
type: i,
|
|
151
151
|
isParent: !s,
|
|
152
|
-
isDeleted: o == null ? void 0 : o.isDeleted
|
|
153
|
-
colorKey: l ?? void 0
|
|
152
|
+
isDeleted: o == null ? void 0 : o.isDeleted
|
|
154
153
|
},
|
|
155
|
-
name:
|
|
154
|
+
name: _,
|
|
156
155
|
description: n,
|
|
157
156
|
groupId: f,
|
|
158
157
|
type: a,
|
|
159
158
|
selected: m === (o == null ? void 0 : o.partyUuid),
|
|
160
159
|
disabled: !!(o != null && o.onlyHierarchyElementWithNoAccess),
|
|
161
160
|
badge: r ? { label: c.you, color: "person" } : o.isDeleted && h ? { label: c.deleted, color: "neutral" } : void 0,
|
|
162
|
-
controls: !r && /* @__PURE__ */
|
|
163
|
-
|
|
161
|
+
controls: !r && /* @__PURE__ */ W(
|
|
162
|
+
q,
|
|
164
163
|
{
|
|
165
164
|
rounded: !0,
|
|
166
165
|
variant: "text",
|
|
167
166
|
icon: d ? Q : X,
|
|
168
167
|
iconAltText: d ? c.remove_from_favorites : c.add_to_favorites,
|
|
169
168
|
onClick: (I) => {
|
|
170
|
-
|
|
169
|
+
v && (I.stopPropagation(), v(o == null ? void 0 : o.partyUuid));
|
|
171
170
|
},
|
|
172
171
|
size: "xs"
|
|
173
172
|
}
|