nve-designsystem 0.1.70 → 0.1.72
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-stepper/nve-step/nve-step.component.d.ts +63 -24
- package/components/nve-stepper/nve-step/nve-step.component.js +185 -59
- package/components/nve-stepper/nve-step/nve-step.styles.js +111 -34
- package/components/nve-stepper/nve-stepper-mobile.component.d.ts +21 -0
- package/components/nve-stepper/nve-stepper-mobile.component.js +69 -0
- package/components/nve-stepper/nve-stepper-mobile.styles.d.ts +2 -0
- package/components/nve-stepper/nve-stepper-mobile.styles.js +65 -0
- package/components/nve-stepper/nve-stepper.component.d.ts +65 -38
- package/components/nve-stepper/nve-stepper.component.js +148 -77
- package/components/nve-stepper/nve-stepper.styles.js +25 -34
- package/components/nve-stepper-demo/nve-stepper-demo.component.d.ts +21 -0
- package/components/nve-stepper-demo/nve-stepper-demo.component.js +225 -0
- package/components/nve-stepper-demo/nve-stepper-demo.styles.d.ts +2 -0
- package/components/nve-stepper-demo/nve-stepper-demo.styles.js +5 -0
- package/custom-elements.json +602 -67
- package/package.json +1 -1
|
@@ -1,56 +1,95 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { CSSResultArray, LitElement, TemplateResult } from 'lit';
|
|
2
|
+
/** Enum for å representere tilstanden til et steg */
|
|
2
3
|
export declare enum StepState {
|
|
3
4
|
NotStarted = 0,
|
|
4
5
|
Started = 1,
|
|
5
6
|
Done = 2,
|
|
6
7
|
Error = 3
|
|
7
8
|
}
|
|
9
|
+
/** Interface for å definere egenskapene til et steg */
|
|
8
10
|
export interface StepProps {
|
|
9
11
|
title: string;
|
|
10
|
-
description
|
|
12
|
+
description?: string;
|
|
11
13
|
state: StepState;
|
|
12
14
|
isSelected: boolean;
|
|
13
15
|
readyForEntrance: boolean;
|
|
16
|
+
disableClick?: boolean;
|
|
17
|
+
orientation?: string;
|
|
14
18
|
}
|
|
19
|
+
/** Komponent for et enkelt steg i en stepper */
|
|
15
20
|
export default class NveStep extends LitElement {
|
|
21
|
+
/** Tittel på steget */
|
|
16
22
|
title: string;
|
|
17
|
-
/**
|
|
18
|
-
* Avstand mellom steppene
|
|
19
|
-
*/
|
|
23
|
+
/** Avstand mellom stegene */
|
|
20
24
|
spaceBetweenSteps: number;
|
|
21
|
-
/**
|
|
22
|
-
* Hvilken ikonbibliotek som skal brukes, Sharp eller Outlined.
|
|
23
|
-
*/
|
|
24
|
-
iconLibrary: 'Outlined' | 'Sharp';
|
|
25
|
-
/**
|
|
26
|
-
* Stegets index
|
|
27
|
-
*/
|
|
25
|
+
/** Indeks for steget */
|
|
28
26
|
index: number;
|
|
27
|
+
/** Beskrivelse av steget */
|
|
29
28
|
description: string;
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
30
|
+
* Stegets tilstand: Ikke startet, påbegynt, fullført eller feilet
|
|
32
31
|
* @type {StepState}
|
|
33
32
|
*/
|
|
34
33
|
state: StepState;
|
|
34
|
+
/** Indeks for det valgte steget */
|
|
35
35
|
selectedStepIndex: number;
|
|
36
|
+
/** Angir om steget er valgt */
|
|
37
|
+
isSelected: boolean;
|
|
38
|
+
/** Angir om steget er det siste i rekken */
|
|
39
|
+
isLast: boolean;
|
|
40
|
+
/** Angir om det er tillatt å gå inn i steget */
|
|
41
|
+
entranceAllowed: boolean;
|
|
42
|
+
/** Deaktiverer muligheten til å klikke på steget for å velge det */
|
|
43
|
+
disableClick: boolean;
|
|
44
|
+
/** Retningen stegene skal gå i: horisontal eller vertikal */
|
|
45
|
+
orientation: 'horizontal' | 'vertical';
|
|
46
|
+
/** Metode som kjøres første gang komponenten er lagt til i DOM */
|
|
47
|
+
firstUpdated(): void;
|
|
48
|
+
/** Metode som kjøres hver gang komponentens oppdateres */
|
|
49
|
+
updated(): void;
|
|
50
|
+
/** Definerer stilene som brukes av komponenten */
|
|
51
|
+
static styles: CSSResultArray;
|
|
52
|
+
/** Sjekker om orienteringen er vertikal */
|
|
53
|
+
isOrientationVertical(): boolean;
|
|
36
54
|
/**
|
|
37
|
-
*
|
|
55
|
+
* Returnerer ikonet for den gitte stegetilstanden
|
|
56
|
+
* @param state - Stegets tilstand
|
|
38
57
|
*/
|
|
39
|
-
|
|
58
|
+
iconForState(state: StepState): string;
|
|
40
59
|
/**
|
|
41
|
-
*
|
|
60
|
+
* Returnerer teksten for den gitte stegetilstanden
|
|
61
|
+
* @param state - Stegets tilstand
|
|
42
62
|
*/
|
|
43
|
-
|
|
63
|
+
getStateText(state: StepState): string;
|
|
44
64
|
/**
|
|
45
|
-
*
|
|
65
|
+
* Returnerer CSS-klassen for fargen til den gitte stegetilstanden
|
|
66
|
+
* @param state - Stegets tilstand
|
|
46
67
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
getStateColorClass(state: StepState): string;
|
|
69
|
+
/**
|
|
70
|
+
* Returnerer CSS-klassen for tittelen til den gitte stegetilstanden
|
|
71
|
+
* @param state - Stegets tilstand
|
|
72
|
+
*/
|
|
73
|
+
getTitleClass(state: StepState): string;
|
|
74
|
+
/**
|
|
75
|
+
* Returnerer CSS-klassen for ikonet til den gitte stegetilstanden
|
|
76
|
+
* @param state - Stegets tilstand
|
|
77
|
+
*/
|
|
78
|
+
getIconClass(state: StepState): string;
|
|
79
|
+
/** Returnerer CSS-klassen for om steget er klikkbart */
|
|
80
|
+
getIsClickableClass(): string;
|
|
81
|
+
/** Returnerer CSS-klassen for fargen til divideren */
|
|
82
|
+
getDividerColorClass(): string;
|
|
83
|
+
/** Håndterer klikk på steget */
|
|
52
84
|
onClick(): void;
|
|
53
|
-
|
|
85
|
+
/** Render divideren mellom stegene */
|
|
86
|
+
renderDivider(): TemplateResult | string;
|
|
87
|
+
/** Render beskrivelsen av steget */
|
|
88
|
+
renderDescription(): TemplateResult | string;
|
|
89
|
+
/** Render vertikalt steg */
|
|
90
|
+
renderVerticalStep(): TemplateResult;
|
|
91
|
+
/** Render metoden for komponenten */
|
|
92
|
+
render(): TemplateResult;
|
|
54
93
|
}
|
|
55
94
|
declare global {
|
|
56
95
|
interface HTMLElementTagNameMap {
|
|
@@ -1,102 +1,228 @@
|
|
|
1
|
-
import { s as
|
|
2
|
-
import { n as r, t as
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
(
|
|
7
|
-
return
|
|
8
|
-
},
|
|
9
|
-
let
|
|
1
|
+
import { s as h, x as o } from "../../../chunks/lit-element.js";
|
|
2
|
+
import { n as r, t as p } from "../../../chunks/property.js";
|
|
3
|
+
import v from "./nve-step.styles.js";
|
|
4
|
+
var u = Object.defineProperty, f = Object.getOwnPropertyDescriptor, s = (t, i, c, l) => {
|
|
5
|
+
for (var a = l > 1 ? void 0 : l ? f(i, c) : i, n = t.length - 1, d; n >= 0; n--)
|
|
6
|
+
(d = t[n]) && (a = (l ? d(i, c, a) : d(a)) || a);
|
|
7
|
+
return l && a && u(i, c, a), a;
|
|
8
|
+
}, C = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.Started = 1] = "Started", t[t.Done = 2] = "Done", t[t.Error = 3] = "Error", t))(C || {});
|
|
9
|
+
let e = class extends h {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(...arguments), this.title = "", this.spaceBetweenSteps = 200, this.
|
|
11
|
+
super(...arguments), this.title = "", this.spaceBetweenSteps = 200, this.index = 0, this.description = "", this.state = 0, this.selectedStepIndex = 0, this.isSelected = !1, this.isLast = !1, this.entranceAllowed = !1, this.disableClick = !1, this.orientation = "horizontal";
|
|
12
12
|
}
|
|
13
|
+
/** Metode som kjøres første gang komponenten er lagt til i DOM */
|
|
13
14
|
firstUpdated() {
|
|
14
15
|
this.style.setProperty("--flex-grow", this.isLast ? "0" : "1");
|
|
15
16
|
}
|
|
17
|
+
/** Metode som kjøres hver gang komponentens oppdateres */
|
|
16
18
|
updated() {
|
|
17
19
|
this.style.setProperty("line-color", this.isLast ? "0" : "1");
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
/** Sjekker om orienteringen er vertikal */
|
|
22
|
+
isOrientationVertical() {
|
|
23
|
+
return this.orientation === "vertical";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returnerer ikonet for den gitte stegetilstanden
|
|
27
|
+
* @param state - Stegets tilstand
|
|
28
|
+
*/
|
|
29
|
+
iconForState(t) {
|
|
30
|
+
let i = "";
|
|
31
|
+
switch (t) {
|
|
22
32
|
case 0:
|
|
23
|
-
|
|
33
|
+
i = "circle";
|
|
24
34
|
break;
|
|
25
35
|
case 1:
|
|
26
|
-
|
|
36
|
+
i = "trip_origin";
|
|
27
37
|
break;
|
|
28
38
|
case 2:
|
|
29
|
-
|
|
39
|
+
i = "check_circle";
|
|
30
40
|
break;
|
|
31
41
|
case 3:
|
|
32
|
-
|
|
42
|
+
i = "error";
|
|
33
43
|
break;
|
|
34
44
|
default:
|
|
35
|
-
|
|
45
|
+
i = "check_circle";
|
|
36
46
|
break;
|
|
37
47
|
}
|
|
38
|
-
return
|
|
48
|
+
return i;
|
|
39
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Returnerer teksten for den gitte stegetilstanden
|
|
52
|
+
* @param state - Stegets tilstand
|
|
53
|
+
*/
|
|
54
|
+
getStateText(t) {
|
|
55
|
+
switch (t) {
|
|
56
|
+
case 0:
|
|
57
|
+
return "Ikke påbegynt";
|
|
58
|
+
case 1:
|
|
59
|
+
return "Aktiv";
|
|
60
|
+
case 2:
|
|
61
|
+
return "Fullført";
|
|
62
|
+
case 3:
|
|
63
|
+
return "Feil";
|
|
64
|
+
default:
|
|
65
|
+
return "Ikke påbegynt";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Returnerer CSS-klassen for fargen til den gitte stegetilstanden
|
|
70
|
+
* @param state - Stegets tilstand
|
|
71
|
+
*/
|
|
72
|
+
getStateColorClass(t) {
|
|
73
|
+
switch (t) {
|
|
74
|
+
case 0:
|
|
75
|
+
return "state-not-started-color";
|
|
76
|
+
case 1:
|
|
77
|
+
return "state-started-color";
|
|
78
|
+
case 2:
|
|
79
|
+
return "state-done-color";
|
|
80
|
+
case 3:
|
|
81
|
+
return "state-error-color";
|
|
82
|
+
default:
|
|
83
|
+
return "state-not-started-color";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returnerer CSS-klassen for tittelen til den gitte stegetilstanden
|
|
88
|
+
* @param state - Stegets tilstand
|
|
89
|
+
*/
|
|
90
|
+
getTitleClass(t) {
|
|
91
|
+
switch (t) {
|
|
92
|
+
case 0:
|
|
93
|
+
return "state-not-started-color";
|
|
94
|
+
case 3:
|
|
95
|
+
return "state-error-color";
|
|
96
|
+
default:
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Returnerer CSS-klassen for ikonet til den gitte stegetilstanden
|
|
102
|
+
* @param state - Stegets tilstand
|
|
103
|
+
*/
|
|
104
|
+
getIconClass(t) {
|
|
105
|
+
switch (t) {
|
|
106
|
+
case 1:
|
|
107
|
+
return "";
|
|
108
|
+
case 0:
|
|
109
|
+
return "state-not-started-icon-color filled-icon";
|
|
110
|
+
case 3:
|
|
111
|
+
return "state-error-color filled-icon";
|
|
112
|
+
default:
|
|
113
|
+
return "filled-icon";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Returnerer CSS-klassen for om steget er klikkbart */
|
|
117
|
+
getIsClickableClass() {
|
|
118
|
+
return this.disableClick ? "disable-click" : "clickable";
|
|
119
|
+
}
|
|
120
|
+
/** Returnerer CSS-klassen for fargen til divideren */
|
|
121
|
+
getDividerColorClass() {
|
|
122
|
+
return this.index < this.selectedStepIndex ? "divider-reached-color" : "divider-not-reached-color";
|
|
123
|
+
}
|
|
124
|
+
/** Håndterer klikk på steget */
|
|
40
125
|
onClick() {
|
|
41
|
-
this.dispatchEvent(new CustomEvent("clicked", { detail: { index: this.index } }));
|
|
126
|
+
this.disableClick || this.dispatchEvent(new CustomEvent("clicked", { detail: { index: this.index } }));
|
|
127
|
+
}
|
|
128
|
+
/** Render divideren mellom stegene */
|
|
129
|
+
renderDivider() {
|
|
130
|
+
const t = this.isOrientationVertical() ? "divider-vertical" : "divider-horizontal";
|
|
131
|
+
return this.isLast ? "" : o`
|
|
132
|
+
<div class="vertical-divider-container">
|
|
133
|
+
<div
|
|
134
|
+
style="${this.isOrientationVertical() ? `height:${this.spaceBetweenSteps}px` : `min-width:${this.spaceBetweenSteps}px`}"
|
|
135
|
+
class="${t} ${this.getDividerColorClass()}"
|
|
136
|
+
></div>
|
|
137
|
+
</div>`;
|
|
138
|
+
}
|
|
139
|
+
/** Render beskrivelsen av steget */
|
|
140
|
+
renderDescription() {
|
|
141
|
+
return this.description ? o`<div class="step-description">${this.description}</div>` : "";
|
|
142
|
+
}
|
|
143
|
+
/** Render vertikalt steg */
|
|
144
|
+
renderVerticalStep() {
|
|
145
|
+
return o`
|
|
146
|
+
<div class="vertical-container">
|
|
147
|
+
<div class="step-figure-vertical">
|
|
148
|
+
<div
|
|
149
|
+
@click="${this.onClick}"
|
|
150
|
+
class="${this.getIsClickableClass()} ${this.getIconClass(this.state)}"
|
|
151
|
+
>
|
|
152
|
+
<nve-icon slot="suffix" name="${this.iconForState(this.state)}"></nve-icon>
|
|
153
|
+
</div>
|
|
154
|
+
${this.renderDivider()}
|
|
155
|
+
</div>
|
|
156
|
+
<div class="text-container-vertical">
|
|
157
|
+
<div class="step-title step-title-vertical ${this.getTitleClass(this.state)}">${this.title}</div>
|
|
158
|
+
<div class="step-state ${this.getStateColorClass(this.state)}">
|
|
159
|
+
${this.getStateText(this.state)}
|
|
160
|
+
</div>
|
|
161
|
+
${this.renderDescription()}
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
`;
|
|
42
165
|
}
|
|
166
|
+
/** Render metoden for komponenten */
|
|
43
167
|
render() {
|
|
44
|
-
return
|
|
45
|
-
<div class="step">
|
|
168
|
+
return this.isOrientationVertical() ? this.renderVerticalStep() : o`
|
|
46
169
|
<div class="step-figure">
|
|
47
170
|
<span
|
|
48
171
|
@click="${this.onClick}"
|
|
49
|
-
class="${this.
|
|
172
|
+
class="${this.getIsClickableClass()} ${this.getIconClass(this.state)}"
|
|
50
173
|
>
|
|
51
|
-
<nve-icon
|
|
174
|
+
<nve-icon slot="suffix" name="${this.iconForState(this.state)}"></nve-icon>
|
|
52
175
|
</span>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
176
|
+
${this.renderDivider()}
|
|
177
|
+
</div>
|
|
178
|
+
<div class="${this.isLast ? "" : "text-container"}">
|
|
179
|
+
<div class="step-title ${this.getTitleClass(this.state)}">${this.title}</div>
|
|
180
|
+
<div class="step-state ${this.getStateColorClass(this.state)}">
|
|
181
|
+
${this.getStateText(this.state)}
|
|
182
|
+
</div>
|
|
183
|
+
${this.renderDescription()}
|
|
58
184
|
</div>
|
|
59
|
-
<div class="step-title">${this.title}</div>
|
|
60
|
-
<div class="step-description">${this.description}</div>
|
|
61
|
-
</div>
|
|
62
185
|
`;
|
|
63
186
|
}
|
|
64
187
|
};
|
|
65
|
-
|
|
66
|
-
|
|
188
|
+
e.styles = [v];
|
|
189
|
+
s([
|
|
67
190
|
r({ reflect: !0 })
|
|
68
|
-
],
|
|
69
|
-
|
|
191
|
+
], e.prototype, "title", 2);
|
|
192
|
+
s([
|
|
70
193
|
r({ type: Number })
|
|
71
|
-
],
|
|
72
|
-
|
|
73
|
-
r({ type: String })
|
|
74
|
-
], s.prototype, "iconLibrary", 2);
|
|
75
|
-
i([
|
|
194
|
+
], e.prototype, "spaceBetweenSteps", 2);
|
|
195
|
+
s([
|
|
76
196
|
r({ type: Number })
|
|
77
|
-
],
|
|
78
|
-
|
|
197
|
+
], e.prototype, "index", 2);
|
|
198
|
+
s([
|
|
79
199
|
r({ type: String })
|
|
80
|
-
],
|
|
81
|
-
|
|
200
|
+
], e.prototype, "description", 2);
|
|
201
|
+
s([
|
|
82
202
|
r({ type: Number })
|
|
83
|
-
],
|
|
84
|
-
|
|
203
|
+
], e.prototype, "state", 2);
|
|
204
|
+
s([
|
|
85
205
|
r({ type: Number })
|
|
86
|
-
],
|
|
87
|
-
|
|
206
|
+
], e.prototype, "selectedStepIndex", 2);
|
|
207
|
+
s([
|
|
88
208
|
r({ type: Boolean, reflect: !0 })
|
|
89
|
-
],
|
|
90
|
-
|
|
209
|
+
], e.prototype, "isSelected", 2);
|
|
210
|
+
s([
|
|
211
|
+
r({ type: Boolean })
|
|
212
|
+
], e.prototype, "isLast", 2);
|
|
213
|
+
s([
|
|
91
214
|
r({ type: Boolean })
|
|
92
|
-
],
|
|
93
|
-
|
|
215
|
+
], e.prototype, "entranceAllowed", 2);
|
|
216
|
+
s([
|
|
94
217
|
r({ type: Boolean })
|
|
95
|
-
],
|
|
96
|
-
s
|
|
97
|
-
|
|
98
|
-
],
|
|
218
|
+
], e.prototype, "disableClick", 2);
|
|
219
|
+
s([
|
|
220
|
+
r()
|
|
221
|
+
], e.prototype, "orientation", 2);
|
|
222
|
+
e = s([
|
|
223
|
+
p("nve-step")
|
|
224
|
+
], e);
|
|
99
225
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
226
|
+
C as StepState,
|
|
227
|
+
e as default
|
|
102
228
|
};
|
|
@@ -1,71 +1,148 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
const
|
|
1
|
+
import { i as e } from "../../../chunks/lit-element.js";
|
|
2
|
+
const o = e`
|
|
3
3
|
:host {
|
|
4
4
|
flex-grow: var(--flex-grow, 1);
|
|
5
5
|
}
|
|
6
|
+
|
|
6
7
|
.step-figure {
|
|
7
8
|
position: relative;
|
|
8
9
|
display: flex;
|
|
9
10
|
align-items: center;
|
|
11
|
+
font-size: 2rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.filled-icon {
|
|
15
|
+
font-variation-settings:
|
|
16
|
+
'FILL' 1,
|
|
17
|
+
'wght' 300,
|
|
18
|
+
'GRAD' 1,
|
|
19
|
+
'opsz' 48 !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.clickable {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.disable-click {
|
|
27
|
+
cursor: default;
|
|
10
28
|
}
|
|
11
29
|
|
|
12
30
|
.divider-horizontal {
|
|
13
31
|
height: 2px;
|
|
14
|
-
background-color: var(--grey-150);
|
|
15
32
|
flex-grow: 1;
|
|
16
33
|
}
|
|
17
34
|
|
|
35
|
+
.text-container {
|
|
36
|
+
padding-right: 1.5rem; /*24px; */
|
|
37
|
+
}
|
|
38
|
+
|
|
18
39
|
.step-title {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
40
|
+
color: var(--neutrals-foreground-primary, #0D0D0E);
|
|
41
|
+
|
|
42
|
+
/* Label/medium */
|
|
43
|
+
font-family: "Source Sans Pro";
|
|
44
|
+
font-size: 1.125rem; /*18px; */
|
|
45
|
+
font-style: normal;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
line-height: 110%;
|
|
48
|
+
padding-top: 0.75rem; /*12px;*/
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.step-state {
|
|
52
|
+
/* Label/x-small-light */
|
|
53
|
+
font-family: "Source Sans Pro";
|
|
54
|
+
font-size: 0.875rem;/*14px;*/
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
line-height: 110%;
|
|
58
|
+
padding-top: 0.25rem; /*4px;*/
|
|
59
|
+
|
|
22
60
|
}
|
|
61
|
+
|
|
23
62
|
.step-description {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
63
|
+
color: var(--neutrals-foreground-primary, #0D0D0E);
|
|
64
|
+
|
|
65
|
+
/* Label/small-light */
|
|
66
|
+
font-family: "Source Sans Pro";
|
|
67
|
+
font-size: 1rem; /*16px; */
|
|
68
|
+
font-style: normal;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
line-height: 110%;
|
|
71
|
+
padding-top: 0.625rem; /*10px; */
|
|
27
72
|
}
|
|
28
73
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
background-color
|
|
74
|
+
|
|
75
|
+
.divider-not-reached-color {
|
|
76
|
+
/* TODO the token --neutrals-background-secondary gives wrong color #c8eaf9 instead of #E4E5E7
|
|
77
|
+
color:var(--neutrals-background-secondary, #E4E5E7); */
|
|
78
|
+
background:#E4E5E7;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.divider-reached-color {
|
|
82
|
+
background: var(--neutrals-foreground-primary, #0D0D0E);
|
|
32
83
|
}
|
|
33
84
|
|
|
34
|
-
.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'GRAD' 1,
|
|
39
|
-
'opsz' 48 !important;
|
|
85
|
+
.state-not-started-icon-color {
|
|
86
|
+
/* TODO the token --neutrals-background-secondary gives wrong color #c8eaf9 instead of #E4E5E7
|
|
87
|
+
color:var(--neutrals-background-secondary, #E4E5E7); */
|
|
88
|
+
color:#E4E5E7;
|
|
40
89
|
}
|
|
41
90
|
|
|
42
|
-
.
|
|
43
|
-
color:
|
|
91
|
+
.state-not-started-color {
|
|
92
|
+
color: var(--neutrals-foreground-subtle, #60656C);
|
|
44
93
|
}
|
|
45
94
|
|
|
46
|
-
.
|
|
47
|
-
color: var(--
|
|
95
|
+
.state-started-color {
|
|
96
|
+
color: var(--feedback-background-emphasized-info, #1E6FDC);
|
|
48
97
|
}
|
|
49
98
|
|
|
50
|
-
.
|
|
51
|
-
|
|
99
|
+
.state-done-color {
|
|
100
|
+
/* TODO the token feeedback is misspelled, should be feedback but --feedback-foreground-emphasized-success gives color */
|
|
101
|
+
color: var(--feeedback-foreground-emphasized-success, #00814B);
|
|
52
102
|
}
|
|
53
103
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
104
|
+
.state-error-color {
|
|
105
|
+
color: var(--feedback-background-emphasized-error, #CC0000);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.vertical-container {
|
|
57
109
|
display: flex;
|
|
110
|
+
align-items: flex-start;
|
|
58
111
|
}
|
|
59
112
|
|
|
60
|
-
.
|
|
113
|
+
.divider-horizontal {
|
|
114
|
+
height: 2px;
|
|
115
|
+
flex-grow: 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.divider-vertical {
|
|
119
|
+
width: 2px;
|
|
120
|
+
align-self: stretch;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.step-figure-vertical {
|
|
124
|
+
display: flex;
|
|
61
125
|
font-size: 2rem;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.vertical-divider-container {
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
padding-top: 1.5px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.text-container-vertical {
|
|
136
|
+
padding-left: 1.5rem; /*24px; */
|
|
137
|
+
justify-content: center;
|
|
67
138
|
}
|
|
139
|
+
|
|
140
|
+
.step-title-vertical {
|
|
141
|
+
padding-top: 0;
|
|
142
|
+
align-self: flex-start;
|
|
143
|
+
}
|
|
144
|
+
|
|
68
145
|
`;
|
|
69
146
|
export {
|
|
70
|
-
|
|
147
|
+
o as default
|
|
71
148
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSResultArray, LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { StepProps } from './nve-step/nve-step.component';
|
|
3
|
+
export default class NveStepperMobile extends LitElement {
|
|
4
|
+
static styles: CSSResultArray;
|
|
5
|
+
/** Steps som skal vises, se StepProps interface for data som skal sendes inn. */
|
|
6
|
+
steps: StepProps[];
|
|
7
|
+
/** Indeks for valgt steg, gir mulighet for å styre hvilket steg som er valgt. */
|
|
8
|
+
selectedStepIndex: {
|
|
9
|
+
value: number;
|
|
10
|
+
};
|
|
11
|
+
/** Skjuler Neste og Forrige knappene slik at du kan implementere dine egne Neste og Forrige knappene. */
|
|
12
|
+
hideStepButtons: boolean;
|
|
13
|
+
private handleNextStep;
|
|
14
|
+
private handlePrevStep;
|
|
15
|
+
render(): TemplateResult;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
'nve-stepper-mobile': NveStepperMobile;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { s as v, x as l } from "../../chunks/lit-element.js";
|
|
2
|
+
import { n as c, t as h } from "../../chunks/property.js";
|
|
3
|
+
import u from "./nve-stepper-mobile.styles.js";
|
|
4
|
+
var a = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (e, s, i, n) => {
|
|
5
|
+
for (var t = n > 1 ? void 0 : n ? b(s, i) : s, r = e.length - 1, d; r >= 0; r--)
|
|
6
|
+
(d = e[r]) && (t = (n ? d(s, i, t) : d(t)) || t);
|
|
7
|
+
return n && t && a(s, i, t), t;
|
|
8
|
+
};
|
|
9
|
+
let p = class extends v {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.steps = [], this.selectedStepIndex = { value: 0 }, this.hideStepButtons = !1;
|
|
12
|
+
}
|
|
13
|
+
handleNextStep() {
|
|
14
|
+
const e = new CustomEvent("next-step", {
|
|
15
|
+
bubbles: !0,
|
|
16
|
+
composed: !0
|
|
17
|
+
});
|
|
18
|
+
this.dispatchEvent(e);
|
|
19
|
+
}
|
|
20
|
+
handlePrevStep() {
|
|
21
|
+
const e = new CustomEvent("prev-step", {
|
|
22
|
+
bubbles: !0,
|
|
23
|
+
composed: !0
|
|
24
|
+
});
|
|
25
|
+
this.dispatchEvent(e);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const e = this.steps[this.selectedStepIndex.value], s = this.steps[this.selectedStepIndex.value + 1], i = this.selectedStepIndex.value === this.steps.length - 1;
|
|
29
|
+
return l`
|
|
30
|
+
<div class="mobile-stepper">
|
|
31
|
+
<div class="progress-circle">
|
|
32
|
+
${this.selectedStepIndex.value + 1} of ${this.steps.length}
|
|
33
|
+
</div>
|
|
34
|
+
<div class="step-info">
|
|
35
|
+
<div class="step-title">${e.title}</div>
|
|
36
|
+
${this.hideStepButtons ? "" : l`
|
|
37
|
+
<div>
|
|
38
|
+
${i ? l`
|
|
39
|
+
<div class="step-buttons next-button" @click=${this.handleNextStep}>
|
|
40
|
+
Finish
|
|
41
|
+
</div>` : l`
|
|
42
|
+
<div class="step-buttons next-button" @click=${this.handleNextStep}>
|
|
43
|
+
Neste: ${s.title}
|
|
44
|
+
</div>`}
|
|
45
|
+
<div class="step-buttons back-button" @click=${this.handlePrevStep}>
|
|
46
|
+
Forrige
|
|
47
|
+
</div>
|
|
48
|
+
</div>`}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
p.styles = [u];
|
|
55
|
+
o([
|
|
56
|
+
c({ type: Array })
|
|
57
|
+
], p.prototype, "steps", 2);
|
|
58
|
+
o([
|
|
59
|
+
c({ type: Object })
|
|
60
|
+
], p.prototype, "selectedStepIndex", 2);
|
|
61
|
+
o([
|
|
62
|
+
c({ type: Boolean })
|
|
63
|
+
], p.prototype, "hideStepButtons", 2);
|
|
64
|
+
p = o([
|
|
65
|
+
h("nve-stepper-mobile")
|
|
66
|
+
], p);
|
|
67
|
+
export {
|
|
68
|
+
p as default
|
|
69
|
+
};
|