nve-designsystem 1.7.0 → 1.9.0
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/components/nve-alert/nve-alert.component.d.ts +4 -2
- package/components/nve-alert/nve-alert.component.js +23 -23
- package/components/nve-alert/nve-alert.styles.js +1 -1
- package/components/nve-link-card/nve-link-card.component.d.ts +1 -1
- package/components/nve-link-card/nve-link-card.component.js +25 -19
- package/components/nve-link-card/nve-link-card.styles.js +18 -18
- package/components/nve-message-card/nve-message-card.component.d.ts +2 -2
- package/components/nve-message-card/nve-message-card.component.js +8 -8
- package/components/nve-message-card/nve-message-card.styles.js +4 -6
- package/components/nve-stepper/nve-step/nve-step.component.d.ts +3 -3
- package/components/nve-stepper/nve-step/nve-step.component.js +39 -40
- package/components/nve-stepper/nve-step/nve-step.styles.js +2 -2
- package/components/nve-stepper/nve-stepper-mobile.component.js +23 -32
- package/components/nve-stepper/nve-stepper-mobile.styles.js +11 -11
- package/components/nve-stepper/nve-stepper.component.js +14 -28
- package/custom-elements.json +403 -403
- package/package.json +1 -1
|
@@ -7,8 +7,10 @@ import { PropertyValues } from 'lit';
|
|
|
7
7
|
*/
|
|
8
8
|
export default class NveAlert extends SlAlert {
|
|
9
9
|
constructor();
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Tykk tekst, vises helt til venstre
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
12
14
|
/** Tynnere beskrivelse tekst */
|
|
13
15
|
text: string;
|
|
14
16
|
/** Bestemmer sterkere bakgrunnsfarge */
|
|
@@ -5,49 +5,49 @@ import "../../chunks/chunk.YHLNUJ7P.js";
|
|
|
5
5
|
import "../../chunks/chunk.4TUIT776.js";
|
|
6
6
|
import h from "./nve-alert.styles.js";
|
|
7
7
|
import { n, t as u } from "../../chunks/property.js";
|
|
8
|
-
var y = Object.defineProperty, m = Object.getOwnPropertyDescriptor,
|
|
9
|
-
for (var t =
|
|
10
|
-
(s = o[e]) && (t = (
|
|
11
|
-
return
|
|
8
|
+
var y = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (o, l, a, p) => {
|
|
9
|
+
for (var t = p > 1 ? void 0 : p ? m(l, a) : l, e = o.length - 1, s; e >= 0; e--)
|
|
10
|
+
(s = o[e]) && (t = (p ? s(l, a, t) : s(t)) || t);
|
|
11
|
+
return p && t && y(l, a, t), t;
|
|
12
12
|
};
|
|
13
|
-
let
|
|
13
|
+
let r = class extends f {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(), this.
|
|
15
|
+
super(), this.label = "", this.text = "", this.saturation = null, this.leftStroke = !1;
|
|
16
16
|
}
|
|
17
17
|
updated(o) {
|
|
18
|
-
var
|
|
19
|
-
if (super.updated(o), o.has("
|
|
20
|
-
const
|
|
18
|
+
var l, a;
|
|
19
|
+
if (super.updated(o), o.has("label") && this.style.setProperty("--nve-alert-label", `"${this.label}"`), o.has("text")) {
|
|
20
|
+
const p = ((l = this.base.querySelector(".alert__message slot")) == null ? void 0 : l.assignedNodes().map((e) => {
|
|
21
21
|
var s;
|
|
22
22
|
return (s = e.textContent) == null ? void 0 : s.trim();
|
|
23
23
|
}).filter((e) => {
|
|
24
24
|
var s;
|
|
25
25
|
return ((s = e ?? "") == null ? void 0 : s.length) > 0;
|
|
26
|
-
}).length) > 0, t = ((
|
|
27
|
-
|
|
26
|
+
}).length) > 0, t = ((a = this.base.querySelector(".alert__message slot")) == null ? void 0 : a.assignedNodes().filter((e) => e.childNodes.length > 0).length) > 0;
|
|
27
|
+
p || t ? this.style.setProperty("--nve-alert-text", '""') : this.style.setProperty("--nve-alert-text", `"${this.text}"`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
r.styles = [
|
|
32
32
|
f.styles,
|
|
33
33
|
// we have to have this otherwise closable is not working
|
|
34
34
|
h
|
|
35
35
|
];
|
|
36
|
-
|
|
36
|
+
i([
|
|
37
37
|
n({ reflect: !0 })
|
|
38
|
-
],
|
|
39
|
-
|
|
38
|
+
], r.prototype, "label", 2);
|
|
39
|
+
i([
|
|
40
40
|
n({ reflect: !0 })
|
|
41
|
-
],
|
|
42
|
-
|
|
41
|
+
], r.prototype, "text", 2);
|
|
42
|
+
i([
|
|
43
43
|
n({ type: String, reflect: !1 })
|
|
44
|
-
],
|
|
45
|
-
|
|
44
|
+
], r.prototype, "saturation", 2);
|
|
45
|
+
i([
|
|
46
46
|
n({ type: Boolean, reflect: !0 })
|
|
47
|
-
],
|
|
48
|
-
|
|
47
|
+
], r.prototype, "leftStroke", 2);
|
|
48
|
+
r = i([
|
|
49
49
|
u("nve-alert")
|
|
50
|
-
],
|
|
50
|
+
], r);
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
r as default
|
|
53
53
|
};
|
|
@@ -5,7 +5,7 @@ import { INveComponent } from '../../interfaces/NveComponent.interface';
|
|
|
5
5
|
*/
|
|
6
6
|
export default class NveLinkCard extends LitElement implements INveComponent {
|
|
7
7
|
/** Tittel som vises øverst på kortet */
|
|
8
|
-
|
|
8
|
+
label: string;
|
|
9
9
|
/** Tilleggsbeskrivelse som vises under tittelen */
|
|
10
10
|
additionalText?: string;
|
|
11
11
|
/** Størrelse på kortet, kan være 'small', 'medium' eller 'large' */
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { i as h, E as f, x as c } from "../../chunks/lit-element.js";
|
|
2
|
-
import { n as
|
|
2
|
+
import { n as o, t as p } from "../../chunks/property.js";
|
|
3
3
|
import w from "./nve-link-card.styles.js";
|
|
4
4
|
var u = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (e, l, n, s) => {
|
|
5
|
-
for (var r = s > 1 ? void 0 : s ? m(l, n) : l,
|
|
6
|
-
(d = e[
|
|
5
|
+
for (var r = s > 1 ? void 0 : s ? m(l, n) : l, a = e.length - 1, d; a >= 0; a--)
|
|
6
|
+
(d = e[a]) && (r = (s ? d(l, n, r) : d(r)) || r);
|
|
7
7
|
return s && r && u(l, n, r), r;
|
|
8
8
|
};
|
|
9
9
|
let t = class extends h {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(...arguments), this.
|
|
11
|
+
super(...arguments), this.label = "", this.size = "medium", this.variant = "primary", this.testId = void 0, this.clickAction = "internal", this.href = void 0, this.downloadHandler = this.defaultDownloadHandler;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Standard nedlastingsfunksjon som brukes hvis downloadHandler ikke er overstyrt.
|
|
14
|
+
* Standard nedlastingsfunksjon som brukes hvis downloadHandler ikke er overstyrt.
|
|
15
15
|
* Bruker lenken (href) til å laste ned en fil.
|
|
16
16
|
*/
|
|
17
17
|
async defaultDownloadHandler() {
|
|
@@ -20,8 +20,8 @@ let t = class extends h {
|
|
|
20
20
|
try {
|
|
21
21
|
const n = await fetch(e, { mode: "cors" });
|
|
22
22
|
if (!n.ok) throw new Error(`Failed to fetch file: ${n.statusText}`);
|
|
23
|
-
const s = await n.blob(), r = URL.createObjectURL(s),
|
|
24
|
-
|
|
23
|
+
const s = await n.blob(), r = URL.createObjectURL(s), a = document.createElement("a");
|
|
24
|
+
a.href = r, a.download = l, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(r);
|
|
25
25
|
} catch {
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -91,9 +91,15 @@ let t = class extends h {
|
|
|
91
91
|
}
|
|
92
92
|
render() {
|
|
93
93
|
return c`
|
|
94
|
-
|
|
94
|
+
<a
|
|
95
|
+
part="link-card"
|
|
96
|
+
class="link-card link-card--${this.size} link-card--${this.variant}"
|
|
97
|
+
tabindex="0"
|
|
98
|
+
@click="${this.handleClick}"
|
|
99
|
+
@keydown="${this.handleKeyDown}"
|
|
100
|
+
>
|
|
95
101
|
<div class="link-card__content">
|
|
96
|
-
<div part="
|
|
102
|
+
<div part="label" class="link-card__label">${this.label}</div>
|
|
97
103
|
${this.additionalText ? c`<div part="additional-text" class="link-card__additional-text">${this.additionalText}</div>` : f}
|
|
98
104
|
</div>
|
|
99
105
|
<div>
|
|
@@ -105,31 +111,31 @@ let t = class extends h {
|
|
|
105
111
|
};
|
|
106
112
|
t.styles = [w];
|
|
107
113
|
i([
|
|
108
|
-
|
|
109
|
-
], t.prototype, "
|
|
114
|
+
o({ reflect: !0 })
|
|
115
|
+
], t.prototype, "label", 2);
|
|
110
116
|
i([
|
|
111
|
-
|
|
117
|
+
o({ reflect: !0 })
|
|
112
118
|
], t.prototype, "additionalText", 2);
|
|
113
119
|
i([
|
|
114
|
-
|
|
120
|
+
o({ reflect: !0 })
|
|
115
121
|
], t.prototype, "size", 2);
|
|
116
122
|
i([
|
|
117
|
-
|
|
123
|
+
o({ reflect: !0 })
|
|
118
124
|
], t.prototype, "variant", 2);
|
|
119
125
|
i([
|
|
120
|
-
|
|
126
|
+
o({ reflect: !0 })
|
|
121
127
|
], t.prototype, "testId", 2);
|
|
122
128
|
i([
|
|
123
|
-
|
|
129
|
+
o({ reflect: !0 })
|
|
124
130
|
], t.prototype, "clickAction", 2);
|
|
125
131
|
i([
|
|
126
|
-
|
|
132
|
+
o({ reflect: !0 })
|
|
127
133
|
], t.prototype, "href", 2);
|
|
128
134
|
i([
|
|
129
|
-
|
|
135
|
+
o()
|
|
130
136
|
], t.prototype, "downloadHandler", 2);
|
|
131
137
|
i([
|
|
132
|
-
|
|
138
|
+
o()
|
|
133
139
|
], t.prototype, "customClickHandler", 2);
|
|
134
140
|
t = i([
|
|
135
141
|
p("nve-link-card")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as r } from "../../chunks/lit-element.js";
|
|
2
|
-
const
|
|
2
|
+
const e = r`
|
|
3
3
|
.link-card {
|
|
4
4
|
border-radius: var(--borderRadius-large, 6px);
|
|
5
5
|
padding: var(--spacing-medium, 16px) var(--spacing-large, 24px);
|
|
@@ -13,15 +13,15 @@ const n = r`
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.link-card:focus {
|
|
16
|
-
outline: var(--interactive-primary-foreground-border-focus, #
|
|
16
|
+
outline: var(--interactive-primary-foreground-border-focus, #008ffb) solid 2px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.link-card:hover .link-
|
|
19
|
+
.link-card:hover .link-card__label {
|
|
20
20
|
text-decoration: underline;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.link-card:active {
|
|
24
|
-
outline: var(--interactive-primary-foreground-border-focus, #
|
|
24
|
+
outline: var(--interactive-primary-foreground-border-focus, #008ffb) solid 2px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.link-card--small {
|
|
@@ -37,20 +37,20 @@ const n = r`
|
|
|
37
37
|
min-height: 70px;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.link-
|
|
40
|
+
.link-card__label {
|
|
41
41
|
font-size: 1rem;
|
|
42
|
-
color: var(--neutrals-foreground-primary, #
|
|
43
|
-
font-family:
|
|
42
|
+
color: var(--neutrals-foreground-primary, #0d0d0e);
|
|
43
|
+
font-family: 'Source Sans Pro';
|
|
44
44
|
font-style: normal;
|
|
45
45
|
font-weight: 400;
|
|
46
46
|
line-height: 150%;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.link-
|
|
49
|
+
.link-card__label--small {
|
|
50
50
|
font-size: 0.875rem;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.link-
|
|
53
|
+
.link-card__label--large {
|
|
54
54
|
font-size: 1.125rem;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -61,8 +61,8 @@ const n = r`
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.link-card__additional-text {
|
|
64
|
-
color: var(--neutrals-foreground-primary, #
|
|
65
|
-
font-family:
|
|
64
|
+
color: var(--neutrals-foreground-primary, #0d0d0e);
|
|
65
|
+
font-family: 'Source Sans Pro';
|
|
66
66
|
font-style: normal;
|
|
67
67
|
font-weight: 400;
|
|
68
68
|
line-height: 120%;
|
|
@@ -71,30 +71,30 @@ const n = r`
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.link-card--primary {
|
|
74
|
-
background: var(--neutrals-background-primary, #
|
|
74
|
+
background: var(--neutrals-background-primary, #fff);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
.link-card--primary:hover {
|
|
78
|
-
background: var(--neutrals-background-secondary, #
|
|
78
|
+
background: var(--neutrals-background-secondary, #e4e5e7);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.link-card--contrast {
|
|
82
|
-
background: var(--neutrals-background-primary-contrast, #
|
|
82
|
+
background: var(--neutrals-background-primary-contrast, #f7f7f8);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.link-card--contrast:hover {
|
|
86
|
-
background: var(--neutrals-background-secondary, #
|
|
86
|
+
background: var(--neutrals-background-secondary, #e4e5e7);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
.link-card--secondary {
|
|
90
|
-
background: var(--neutrals-background-secondary, #
|
|
90
|
+
background: var(--neutrals-background-secondary, #e4e5e7);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.link-card--secondary:hover {
|
|
94
94
|
border-radius: var(--borderRadius-large, 6px);
|
|
95
|
-
border: 2px solid var(--neutrals-foreground-primary, #
|
|
95
|
+
border: 2px solid var(--neutrals-foreground-primary, #0d0d0e);
|
|
96
96
|
}
|
|
97
97
|
`;
|
|
98
98
|
export {
|
|
99
|
-
|
|
99
|
+
e as default
|
|
100
100
|
};
|
|
@@ -17,7 +17,7 @@ Brukes som veiledning i skjemaer eller som en informasjon til brukere.
|
|
|
17
17
|
* @csspart base - hoved komponent kontainer.
|
|
18
18
|
* @csspart header - header seksjonen.
|
|
19
19
|
* @csspart subheader - subheader seksjonen.
|
|
20
|
-
* @csspart
|
|
20
|
+
* @csspart label - tittel i header seksjonen.
|
|
21
21
|
* @csspart footer - footer seksjonen.
|
|
22
22
|
*/
|
|
23
23
|
export default class NveMessageCard extends LitElement implements INveComponent {
|
|
@@ -31,7 +31,7 @@ export default class NveMessageCard extends LitElement implements INveComponent
|
|
|
31
31
|
/** Viser ikonen ved siden i header seksjonen */
|
|
32
32
|
showIcon: 'true' | 'false';
|
|
33
33
|
/** Tittel i header seksjonen */
|
|
34
|
-
|
|
34
|
+
label: string;
|
|
35
35
|
/** Beskrivelse tekst under tittelen */
|
|
36
36
|
text: string;
|
|
37
37
|
/** Man kan velge ikon i headeren, enten kommer en default en */
|
|
@@ -3,14 +3,14 @@ import { n as r, t as u } from "../../chunks/property.js";
|
|
|
3
3
|
import { e as h } from "../../chunks/class-map.js";
|
|
4
4
|
import m from "./nve-message-card.styles.js";
|
|
5
5
|
import "../nve-icon/nve-icon.component.js";
|
|
6
|
-
var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (s, a,
|
|
7
|
-
for (var i = o > 1 ? void 0 : o ? g(a,
|
|
8
|
-
(d = s[
|
|
9
|
-
return o && i && v(a,
|
|
6
|
+
var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (s, a, l, o) => {
|
|
7
|
+
for (var i = o > 1 ? void 0 : o ? g(a, l) : a, c = s.length - 1, d; c >= 0; c--)
|
|
8
|
+
(d = s[c]) && (i = (o ? d(a, l, i) : d(i)) || i);
|
|
9
|
+
return o && i && v(a, l, i), i;
|
|
10
10
|
};
|
|
11
11
|
let e = class extends p {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(), this.testId = "", this.saturation = null, this.size = "default", this.closable = !1, this.showIcon = "true", this.
|
|
13
|
+
super(), this.testId = "", this.saturation = null, this.size = "default", this.closable = !1, this.showIcon = "true", this.label = "", this.text = "", this.iconTitle = "", this.variant = "primary";
|
|
14
14
|
}
|
|
15
15
|
handleClose() {
|
|
16
16
|
var a;
|
|
@@ -60,9 +60,9 @@ let e = class extends p {
|
|
|
60
60
|
<div class="message-card__header-container">
|
|
61
61
|
<div part="header" class="message-card__header">
|
|
62
62
|
<slot part="subheader" name="subheader" class="message-card__subheader"></slot>
|
|
63
|
-
<div part="
|
|
63
|
+
<div part="label" class="message-card__header-label">
|
|
64
64
|
${this.showIcon === "true" ? n`<nve-icon name=${this.determineIcon()}></nve-icon>` : null}
|
|
65
|
-
${this.
|
|
65
|
+
${this.label ? n`<span>${this.label}</span>` : null}
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
68
|
${this.closable ? n`<button type="button" class="message-card__close-btn" @click=${this.handleClose}>
|
|
@@ -93,7 +93,7 @@ t([
|
|
|
93
93
|
], e.prototype, "showIcon", 2);
|
|
94
94
|
t([
|
|
95
95
|
r({ reflect: !0 })
|
|
96
|
-
], e.prototype, "
|
|
96
|
+
], e.prototype, "label", 2);
|
|
97
97
|
t([
|
|
98
98
|
r({ reflect: !0 })
|
|
99
99
|
], e.prototype, "text", 2);
|
|
@@ -35,7 +35,7 @@ const r = e`
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/* tittelen blir kuttet hvis for langt i utgangspunktet */
|
|
38
|
-
.message-card__header-
|
|
38
|
+
.message-card__header-label {
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
gap: 8px;
|
|
@@ -76,7 +76,7 @@ const r = e`
|
|
|
76
76
|
|
|
77
77
|
nve-icon::part(icon) {
|
|
78
78
|
display: unset;
|
|
79
|
-
font-size: 22px
|
|
79
|
+
font-size: 22px;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/** Varianter */
|
|
@@ -167,13 +167,11 @@ const r = e`
|
|
|
167
167
|
gap: var(--spacing-x-small);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
:host([size='compact']) .message-card__header-title {
|
|
170
|
+
:host([size='compact']) .message-card__header-label {
|
|
173
171
|
font: var(--label-medium);
|
|
174
172
|
}
|
|
175
173
|
|
|
176
|
-
:host([size='simple']) .message-card__header-
|
|
174
|
+
:host([size='simple']) .message-card__header-label {
|
|
177
175
|
font: var(--label-medium-light);
|
|
178
176
|
}
|
|
179
177
|
|
|
@@ -9,7 +9,7 @@ export declare enum StepState {
|
|
|
9
9
|
}
|
|
10
10
|
/** Interface for å definere egenskapene til et steg */
|
|
11
11
|
export interface StepProps {
|
|
12
|
-
|
|
12
|
+
label: string;
|
|
13
13
|
description?: string;
|
|
14
14
|
state: StepState;
|
|
15
15
|
isSelected: boolean;
|
|
@@ -21,7 +21,7 @@ export interface StepProps {
|
|
|
21
21
|
/** Komponent for et enkelt steg i en stepper */
|
|
22
22
|
export default class NveStep extends LitElement {
|
|
23
23
|
/** Tittel på steget */
|
|
24
|
-
|
|
24
|
+
label: string;
|
|
25
25
|
/** Indeks for steget */
|
|
26
26
|
index: number;
|
|
27
27
|
/** Beskrivelse av steget */
|
|
@@ -57,7 +57,7 @@ export default class NveStep extends LitElement {
|
|
|
57
57
|
private iconForState;
|
|
58
58
|
private getStateText;
|
|
59
59
|
private getStateColorClass;
|
|
60
|
-
private
|
|
60
|
+
private getLabelClass;
|
|
61
61
|
private getIconClass;
|
|
62
62
|
private getDividerColorClass;
|
|
63
63
|
private renderDivider;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { i as h, x as
|
|
1
|
+
import { i as h, x as l } from "../../../chunks/lit-element.js";
|
|
2
2
|
import { n as r, t as p } from "../../../chunks/property.js";
|
|
3
3
|
import { e as v } from "../../../chunks/query.js";
|
|
4
4
|
import u from "./nve-step.styles.js";
|
|
5
|
-
var f = Object.defineProperty, y = Object.getOwnPropertyDescriptor, s = (t, i, n,
|
|
6
|
-
for (var
|
|
7
|
-
(d = t[
|
|
8
|
-
return
|
|
5
|
+
var f = Object.defineProperty, y = Object.getOwnPropertyDescriptor, s = (t, i, n, a) => {
|
|
6
|
+
for (var o = a > 1 ? void 0 : a ? y(i, n) : i, c = t.length - 1, d; c >= 0; c--)
|
|
7
|
+
(d = t[c]) && (o = (a ? d(i, n, o) : d(o)) || o);
|
|
8
|
+
return a && o && f(i, n, o), o;
|
|
9
9
|
}, g = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.Started = 1] = "Started", t[t.Active = 2] = "Active", t[t.Done = 3] = "Done", t[t.Error = 4] = "Error", t))(g || {});
|
|
10
10
|
let e = class extends h {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments), this.
|
|
12
|
+
super(...arguments), this.label = "", this.index = 0, this.state = 0, this.selectedStepIndex = 0, this.isSelected = !1, this.isLast = !1, this.entranceAllowed = !1, this.orientation = "horizontal", this.hideStateText = !1, this.hideDescriptions = !1;
|
|
13
13
|
}
|
|
14
14
|
/** Metode som kjøres første gang komponenten er lagt til i DOM */
|
|
15
15
|
firstUpdated() {
|
|
@@ -76,7 +76,7 @@ let e = class extends h {
|
|
|
76
76
|
return "state-not-started-color";
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
getLabelClass(t) {
|
|
80
80
|
switch (t) {
|
|
81
81
|
case 0:
|
|
82
82
|
return "state-not-started-color";
|
|
@@ -103,15 +103,18 @@ let e = class extends h {
|
|
|
103
103
|
}
|
|
104
104
|
renderDivider() {
|
|
105
105
|
const t = this.isOrientationVertical() ? "divider-vertical" : "divider-horizontal";
|
|
106
|
-
return this.isLast ? "" :
|
|
107
|
-
<div class="
|
|
108
|
-
<div
|
|
109
|
-
class="${t} ${this.getDividerColorClass()}"
|
|
110
|
-
></div>
|
|
106
|
+
return this.isLast ? "" : l` <div class="vertical-divider-container">
|
|
107
|
+
<div class="${t} ${this.getDividerColorClass()}"></div>
|
|
111
108
|
</div>`;
|
|
112
109
|
}
|
|
113
110
|
renderDescription() {
|
|
114
|
-
return this.isDescriptionValid(this.description) ?
|
|
111
|
+
return this.isDescriptionValid(this.description) ? l`<div
|
|
112
|
+
class="step-description ${this.orientation === "vertical" ? "step-description-max-width-vertical" : "step-description-max-width-horizontal"}"
|
|
113
|
+
>
|
|
114
|
+
${this.description}
|
|
115
|
+
</div>` : l`<div
|
|
116
|
+
class="step-description empty-description ${this.orientation === "vertical" ? "step-description-max-width-vertical" : "step-description-max-width-horizontal"}"
|
|
117
|
+
></div>`;
|
|
115
118
|
}
|
|
116
119
|
isDescriptionValid(t) {
|
|
117
120
|
return !!t && (t == null ? void 0 : t.trim().length) > 0;
|
|
@@ -120,56 +123,52 @@ let e = class extends h {
|
|
|
120
123
|
updateVerticalDividerHeight() {
|
|
121
124
|
let n = 34;
|
|
122
125
|
this.descriptionElement && (n = this.descriptionElement.offsetHeight + 24);
|
|
123
|
-
const
|
|
124
|
-
|
|
126
|
+
const a = this.shadowRoot.querySelector(
|
|
127
|
+
".vertical-divider-container .divider-vertical"
|
|
128
|
+
);
|
|
129
|
+
a && (a.style.height = `${n}px`);
|
|
125
130
|
}
|
|
126
131
|
renderVerticalStep() {
|
|
127
|
-
return
|
|
132
|
+
return l`
|
|
128
133
|
<div class="vertical-container">
|
|
129
134
|
<div class="step-figure-vertical">
|
|
130
|
-
<div
|
|
131
|
-
class=" ${this.getIconClass(this.state)}"
|
|
132
|
-
>
|
|
135
|
+
<div class=" ${this.getIconClass(this.state)}">
|
|
133
136
|
<nve-icon slot="suffix" name="${this.iconForState(this.state)}"></nve-icon>
|
|
134
137
|
</div>
|
|
135
138
|
${this.renderDivider()}
|
|
136
139
|
</div>
|
|
137
140
|
<div class="text-container-vertical">
|
|
138
|
-
<div class="step-
|
|
141
|
+
<div class="step-label step-label-vertical ${this.getLabelClass(this.state)}">${this.label}</div>
|
|
139
142
|
<div class="step-state ${this.getStateColorClass(this.state)}">
|
|
140
143
|
${this.hideStateText ? "" : this.getStateText(this.state)}
|
|
141
144
|
</div>
|
|
142
|
-
<div>
|
|
143
|
-
${this.hideDescriptions ? "" : this.renderDescription()}
|
|
144
|
-
</div>
|
|
145
|
+
<div>${this.hideDescriptions ? "" : this.renderDescription()}</div>
|
|
145
146
|
</div>
|
|
146
147
|
</div>
|
|
147
148
|
`;
|
|
148
149
|
}
|
|
149
150
|
render() {
|
|
150
|
-
return this.isOrientationVertical() ? this.renderVerticalStep() :
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
</
|
|
157
|
-
${this.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
${this.hideStateText ? "" : this.getStateText(this.state)}
|
|
163
|
-
</div>
|
|
151
|
+
return this.isOrientationVertical() ? this.renderVerticalStep() : l`
|
|
152
|
+
<div class="step-figure">
|
|
153
|
+
<span class=" ${this.getIconClass(this.state)}">
|
|
154
|
+
<nve-icon slot="suffix" name="${this.iconForState(this.state)}"></nve-icon>
|
|
155
|
+
</span>
|
|
156
|
+
${this.renderDivider()}
|
|
157
|
+
</div>
|
|
158
|
+
<div class="${this.isLast ? "" : "text-container"}">
|
|
159
|
+
<div class="step-label ${this.getLabelClass(this.state)}">${this.label}</div>
|
|
160
|
+
<div class="step-state ${this.getStateColorClass(this.state)}">
|
|
161
|
+
${this.hideStateText ? "" : this.getStateText(this.state)}
|
|
162
|
+
</div>
|
|
164
163
|
${this.hideDescriptions ? "" : this.renderDescription()}
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
</div>
|
|
165
|
+
`;
|
|
167
166
|
}
|
|
168
167
|
};
|
|
169
168
|
e.styles = [u];
|
|
170
169
|
s([
|
|
171
170
|
r({ reflect: !0 })
|
|
172
|
-
], e.prototype, "
|
|
171
|
+
], e.prototype, "label", 2);
|
|
173
172
|
s([
|
|
174
173
|
r({ type: Number })
|
|
175
174
|
], e.prototype, "index", 2);
|
|
@@ -43,7 +43,7 @@ const r = e`
|
|
|
43
43
|
width: 100%;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.step-
|
|
46
|
+
.step-label {
|
|
47
47
|
color: var(--neutrals-foreground-primary, #0d0d0e);
|
|
48
48
|
|
|
49
49
|
/* Label/medium */
|
|
@@ -167,7 +167,7 @@ const r = e`
|
|
|
167
167
|
flex: 10;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
.step-
|
|
170
|
+
.step-label-vertical {
|
|
171
171
|
padding-top: 0;
|
|
172
172
|
align-self: flex-start;
|
|
173
173
|
}
|