@altinn/altinn-components 0.52.1 → 0.52.3
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,71 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { Badge as y } from "../Badge/Badge.js";
|
|
1
|
+
import { jsx as e, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as h } from "../Badge/Badge.js";
|
|
4
3
|
import "../../index-L8X2o7IH.js";
|
|
5
|
-
import
|
|
4
|
+
import "react";
|
|
6
5
|
import "../RootProvider/RootProvider.js";
|
|
7
6
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { ListItemLabel as
|
|
9
|
-
import { ListItem as
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let i = _();
|
|
22
|
-
return i = l ? t || "title-" + i : void 0, m.createElement(
|
|
23
|
-
"svg",
|
|
24
|
-
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: r, "aria-labelledby": i }, a),
|
|
25
|
-
l ? m.createElement("title", { id: i }, l) : null,
|
|
26
|
-
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.625 2.35a.75.75 0 0 1 .75 0l7.794 4.5a.75.75 0 0 1 .375.65v9a.75.75 0 0 1-.375.65l-7.779 4.49a.75.75 0 0 1-.39.11h-.006a.76.76 0 0 1-.373-.103L3.83 17.15a.75.75 0 0 1-.375-.65V7.494a.75.75 0 0 1 .382-.648zm-.375 17.351-6.294-3.634V8.799l3.486 2.013a3.751 3.751 0 0 0 2.808 4.863zM15.75 12a3.75 3.75 0 0 1-3 3.675v4.026l6.294-3.634V8.799l-3.486 2.013c.124.373.192.773.192 1.188m-1.79-1.105a2.25 2.25 0 1 1-3.919-.003l.01-.017.01-.016a2.249 2.249 0 0 1 3.9.036m.847-1.382L18.294 7.5 12 3.866 5.706 7.5l3.487 2.013A3.74 3.74 0 0 1 12 8.25a3.74 3.74 0 0 1 2.807 1.263", clipRule: "evenodd" })
|
|
27
|
-
);
|
|
28
|
-
}), I = "_badges_1csip_1", j = "_label_1csip_11", f = {
|
|
29
|
-
badges: I,
|
|
30
|
-
label: j
|
|
31
|
-
}, B = ({
|
|
32
|
-
name: e,
|
|
33
|
-
type: r,
|
|
34
|
-
description: l,
|
|
35
|
-
roleNames: t,
|
|
36
|
-
titleAs: a = "h3",
|
|
37
|
-
subUnit: i = !1,
|
|
38
|
-
loading: c = !1,
|
|
7
|
+
import { ListItemLabel as p } from "../List/ListItemLabel.js";
|
|
8
|
+
import { ListItem as L } from "../List/ListItem.js";
|
|
9
|
+
import '../../assets/UserListItem.css';const g = "_badges_1csip_1", z = "_label_1csip_11", r = {
|
|
10
|
+
badges: g,
|
|
11
|
+
label: z
|
|
12
|
+
}, P = ({
|
|
13
|
+
name: t,
|
|
14
|
+
type: l,
|
|
15
|
+
description: c,
|
|
16
|
+
roleNames: o,
|
|
17
|
+
titleAs: m = "h3",
|
|
18
|
+
subUnit: b = !1,
|
|
19
|
+
loading: i = !1,
|
|
39
20
|
...s
|
|
40
21
|
}) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
break;
|
|
49
|
-
case "system":
|
|
50
|
-
o = O;
|
|
51
|
-
break;
|
|
52
|
-
default:
|
|
53
|
-
o = { name: e, type: "person" };
|
|
54
|
-
}
|
|
55
|
-
const b = !c && t ? /* @__PURE__ */ n("div", { className: f.badges, children: t.map((d) => /* @__PURE__ */ n(y, { label: d, color: s.color, children: d }, d)) }) : void 0, p = /* @__PURE__ */ u("div", { className: f.label, "data-size": s.size, children: [
|
|
56
|
-
/* @__PURE__ */ n(
|
|
57
|
-
g,
|
|
22
|
+
const d = {
|
|
23
|
+
name: t,
|
|
24
|
+
type: l,
|
|
25
|
+
isParent: l === "company" && !b
|
|
26
|
+
}, n = !i && o ? /* @__PURE__ */ e("div", { className: r.badges, children: o.map((a) => /* @__PURE__ */ e(h, { label: a, color: s.color, children: a }, a)) }) : void 0, f = /* @__PURE__ */ _("div", { className: r.label, "data-size": s.size, children: [
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
p,
|
|
58
29
|
{
|
|
59
|
-
title: { children:
|
|
60
|
-
description:
|
|
30
|
+
title: { children: t, as: m },
|
|
31
|
+
description: c,
|
|
61
32
|
size: s.size,
|
|
62
|
-
loading:
|
|
33
|
+
loading: i
|
|
63
34
|
}
|
|
64
35
|
),
|
|
65
|
-
|
|
36
|
+
n
|
|
66
37
|
] });
|
|
67
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ e(L, { icon: d, ariaLabel: t, label: f, description: c, loading: i, ...s });
|
|
68
39
|
};
|
|
69
40
|
export {
|
|
70
|
-
|
|
41
|
+
P as UserListItem
|
|
71
42
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { AvatarType } from '../../components';
|
|
1
2
|
interface FormatDisplayNameInput {
|
|
2
3
|
/** Full name of person or company */
|
|
3
4
|
fullName: string;
|
|
4
|
-
/** Entity type: Whether this is a person or a company */
|
|
5
|
-
type:
|
|
5
|
+
/** Entity type: Whether this is a person, system user or a company */
|
|
6
|
+
type: AvatarType;
|
|
6
7
|
/** For persons: switch order of first/last name */
|
|
7
8
|
reverseNameOrder?: boolean;
|
|
8
9
|
}
|