nve-designsystem 0.1.70 → 0.1.71
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 +27 -25
- package/components/nve-stepper/nve-step/nve-step.component.js +155 -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 +37 -38
- package/components/nve-stepper/nve-stepper.component.js +134 -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 +697 -213
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { CSSResultArray, LitElement, TemplateResult } from 'lit';
|
|
2
2
|
export declare enum StepState {
|
|
3
3
|
NotStarted = 0,
|
|
4
4
|
Started = 1,
|
|
@@ -7,50 +7,52 @@ export declare enum StepState {
|
|
|
7
7
|
}
|
|
8
8
|
export interface StepProps {
|
|
9
9
|
title: string;
|
|
10
|
-
description
|
|
10
|
+
description?: string;
|
|
11
11
|
state: StepState;
|
|
12
12
|
isSelected: boolean;
|
|
13
13
|
readyForEntrance: boolean;
|
|
14
|
+
disableClick?: boolean;
|
|
15
|
+
orientation?: string;
|
|
14
16
|
}
|
|
15
17
|
export default class NveStep extends LitElement {
|
|
16
18
|
title: string;
|
|
17
|
-
/**
|
|
18
|
-
* Avstand mellom steppene
|
|
19
|
-
*/
|
|
19
|
+
/** Avstand mellom Steps */
|
|
20
20
|
spaceBetweenSteps: number;
|
|
21
|
-
/**
|
|
22
|
-
* Hvilken ikonbibliotek som skal brukes, Sharp eller Outlined.
|
|
23
|
-
*/
|
|
24
|
-
iconLibrary: 'Outlined' | 'Sharp';
|
|
25
|
-
/**
|
|
26
|
-
* Stegets index
|
|
27
|
-
*/
|
|
21
|
+
/** Step index */
|
|
28
22
|
index: number;
|
|
29
23
|
description: string;
|
|
30
24
|
/**
|
|
31
|
-
* Er
|
|
25
|
+
* Er Step besøkt, ikke besøkt, fullført eller feilet
|
|
32
26
|
* @type {StepState}
|
|
33
27
|
*/
|
|
34
28
|
state: StepState;
|
|
35
29
|
selectedStepIndex: number;
|
|
36
|
-
/**
|
|
37
|
-
* Er steget valgt
|
|
38
|
-
*/
|
|
30
|
+
/** Er Step valgt */
|
|
39
31
|
isSelected: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Er steget det siste i rekken
|
|
42
|
-
*/
|
|
32
|
+
/** Er Step det siste i rekken */
|
|
43
33
|
isLast: boolean;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
/** Er det lov å gå inn i Step, alle krav er oppfylt */
|
|
35
|
+
entranceAllowed: boolean;
|
|
36
|
+
/** Deaktiverer muligheten til å klikke på komponenten slik at den blir valgt.*/
|
|
37
|
+
disableClick: boolean;
|
|
38
|
+
/** Hvilken retning Steps skal gå. */
|
|
39
|
+
orientation: 'horizontal' | 'vertical';
|
|
48
40
|
firstUpdated(): void;
|
|
49
41
|
updated(): void;
|
|
50
|
-
static styles:
|
|
42
|
+
static styles: CSSResultArray;
|
|
43
|
+
isOrientationVertical(): boolean;
|
|
51
44
|
iconForState(state: StepState): string;
|
|
45
|
+
getStateText(state: StepState): string;
|
|
46
|
+
getStateColorClass(state: StepState): string;
|
|
47
|
+
getTitleClass(state: StepState): string;
|
|
48
|
+
getIconClass(state: StepState): string;
|
|
49
|
+
getIsClickableClass(): string;
|
|
50
|
+
getDividerColorClass(): string;
|
|
52
51
|
onClick(): void;
|
|
53
|
-
|
|
52
|
+
renderDivider(): TemplateResult | string;
|
|
53
|
+
renderDescription(): TemplateResult | string;
|
|
54
|
+
renderVerticalStep(): TemplateResult;
|
|
55
|
+
render(): TemplateResult;
|
|
54
56
|
}
|
|
55
57
|
declare global {
|
|
56
58
|
interface HTMLElementTagNameMap {
|
|
@@ -1,14 +1,14 @@
|
|
|
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
13
|
firstUpdated() {
|
|
14
14
|
this.style.setProperty("--flex-grow", this.isLast ? "0" : "1");
|
|
@@ -16,87 +16,183 @@ let s = class extends d {
|
|
|
16
16
|
updated() {
|
|
17
17
|
this.style.setProperty("line-color", this.isLast ? "0" : "1");
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
isOrientationVertical() {
|
|
20
|
+
return this.orientation === "vertical";
|
|
21
|
+
}
|
|
22
|
+
iconForState(t) {
|
|
23
|
+
let i = "";
|
|
24
|
+
switch (t) {
|
|
22
25
|
case 0:
|
|
23
|
-
|
|
26
|
+
i = "circle";
|
|
24
27
|
break;
|
|
25
28
|
case 1:
|
|
26
|
-
|
|
29
|
+
i = "trip_origin";
|
|
27
30
|
break;
|
|
28
31
|
case 2:
|
|
29
|
-
|
|
32
|
+
i = "check_circle";
|
|
30
33
|
break;
|
|
31
34
|
case 3:
|
|
32
|
-
|
|
35
|
+
i = "error";
|
|
33
36
|
break;
|
|
34
37
|
default:
|
|
35
|
-
|
|
38
|
+
i = "check_circle";
|
|
36
39
|
break;
|
|
37
40
|
}
|
|
38
|
-
return
|
|
41
|
+
return i;
|
|
42
|
+
}
|
|
43
|
+
getStateText(t) {
|
|
44
|
+
switch (t) {
|
|
45
|
+
case 0:
|
|
46
|
+
return "Ikke påbegynt";
|
|
47
|
+
case 1:
|
|
48
|
+
return "Aktiv";
|
|
49
|
+
case 2:
|
|
50
|
+
return "Fullført";
|
|
51
|
+
case 3:
|
|
52
|
+
return "Feil";
|
|
53
|
+
default:
|
|
54
|
+
return "Ikke påbegynt";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
getStateColorClass(t) {
|
|
58
|
+
switch (t) {
|
|
59
|
+
case 0:
|
|
60
|
+
return "state-not-started-color";
|
|
61
|
+
case 1:
|
|
62
|
+
return "state-started-color";
|
|
63
|
+
case 2:
|
|
64
|
+
return "state-done-color";
|
|
65
|
+
case 3:
|
|
66
|
+
return "state-error-color";
|
|
67
|
+
default:
|
|
68
|
+
return "state-not-started-color";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
getTitleClass(t) {
|
|
72
|
+
switch (t) {
|
|
73
|
+
case 0:
|
|
74
|
+
return "state-not-started-color";
|
|
75
|
+
case 3:
|
|
76
|
+
return "state-error-color";
|
|
77
|
+
default:
|
|
78
|
+
return "";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
getIconClass(t) {
|
|
82
|
+
switch (t) {
|
|
83
|
+
case 1:
|
|
84
|
+
return "";
|
|
85
|
+
case 0:
|
|
86
|
+
return "state-not-started-icon-color filled-icon";
|
|
87
|
+
case 3:
|
|
88
|
+
return "state-error-color filled-icon";
|
|
89
|
+
default:
|
|
90
|
+
return "filled-icon";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
getIsClickableClass() {
|
|
94
|
+
return this.disableClick ? "disable-click" : "clickable";
|
|
95
|
+
}
|
|
96
|
+
getDividerColorClass() {
|
|
97
|
+
return this.index < this.selectedStepIndex ? "divider-reached-color" : "divider-not-reached-color";
|
|
39
98
|
}
|
|
40
99
|
onClick() {
|
|
41
|
-
this.dispatchEvent(new CustomEvent("clicked", { detail: { index: this.index } }));
|
|
100
|
+
this.disableClick || this.dispatchEvent(new CustomEvent("clicked", { detail: { index: this.index } }));
|
|
101
|
+
}
|
|
102
|
+
renderDivider() {
|
|
103
|
+
const t = this.isOrientationVertical() ? "divider-vertical" : "divider-horizontal";
|
|
104
|
+
return this.isLast ? "" : o`
|
|
105
|
+
<div class="vertical-divider-container">
|
|
106
|
+
<div
|
|
107
|
+
style="${this.isOrientationVertical() ? `height:${this.spaceBetweenSteps}px` : `min-width:${this.spaceBetweenSteps}px`}"
|
|
108
|
+
class="${t} ${this.getDividerColorClass()}"
|
|
109
|
+
></div>
|
|
110
|
+
</div>`;
|
|
111
|
+
}
|
|
112
|
+
renderDescription() {
|
|
113
|
+
return this.description ? o`<div class="step-description">${this.description}</div>` : "";
|
|
114
|
+
}
|
|
115
|
+
renderVerticalStep() {
|
|
116
|
+
return o`
|
|
117
|
+
<div class="vertical-container">
|
|
118
|
+
<div class="step-figure-vertical">
|
|
119
|
+
<div
|
|
120
|
+
@click="${this.onClick}"
|
|
121
|
+
class="${this.getIsClickableClass()} ${this.getIconClass(this.state)}"
|
|
122
|
+
>
|
|
123
|
+
<nve-icon slot="suffix" name="${this.iconForState(this.state)}"></nve-icon>
|
|
124
|
+
</div>
|
|
125
|
+
${this.renderDivider()}
|
|
126
|
+
</div>
|
|
127
|
+
<div class="text-container-vertical">
|
|
128
|
+
<div class="step-title step-title-vertical ${this.getTitleClass(this.state)}">${this.title}</div>
|
|
129
|
+
<div class="step-state ${this.getStateColorClass(this.state)}">
|
|
130
|
+
${this.getStateText(this.state)}
|
|
131
|
+
</div>
|
|
132
|
+
${this.renderDescription()}
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
`;
|
|
42
136
|
}
|
|
43
137
|
render() {
|
|
44
|
-
return
|
|
45
|
-
<div class="step">
|
|
138
|
+
return this.isOrientationVertical() ? this.renderVerticalStep() : o`
|
|
46
139
|
<div class="step-figure">
|
|
47
140
|
<span
|
|
48
141
|
@click="${this.onClick}"
|
|
49
|
-
class="${this.
|
|
142
|
+
class="${this.getIsClickableClass()} ${this.getIconClass(this.state)}"
|
|
50
143
|
>
|
|
51
|
-
<nve-icon
|
|
144
|
+
<nve-icon slot="suffix" name="${this.iconForState(this.state)}"></nve-icon>
|
|
52
145
|
</span>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
146
|
+
${this.renderDivider()}
|
|
147
|
+
</div>
|
|
148
|
+
<div class="${this.isLast ? "" : "text-container"}">
|
|
149
|
+
<div class="step-title ${this.getTitleClass(this.state)}">${this.title}</div>
|
|
150
|
+
<div class="step-state ${this.getStateColorClass(this.state)}">
|
|
151
|
+
${this.getStateText(this.state)}
|
|
152
|
+
</div>
|
|
153
|
+
${this.renderDescription()}
|
|
58
154
|
</div>
|
|
59
|
-
<div class="step-title">${this.title}</div>
|
|
60
|
-
<div class="step-description">${this.description}</div>
|
|
61
|
-
</div>
|
|
62
155
|
`;
|
|
63
156
|
}
|
|
64
157
|
};
|
|
65
|
-
|
|
66
|
-
|
|
158
|
+
e.styles = [v];
|
|
159
|
+
s([
|
|
67
160
|
r({ reflect: !0 })
|
|
68
|
-
],
|
|
69
|
-
|
|
161
|
+
], e.prototype, "title", 2);
|
|
162
|
+
s([
|
|
70
163
|
r({ type: Number })
|
|
71
|
-
],
|
|
72
|
-
|
|
73
|
-
r({ type: String })
|
|
74
|
-
], s.prototype, "iconLibrary", 2);
|
|
75
|
-
i([
|
|
164
|
+
], e.prototype, "spaceBetweenSteps", 2);
|
|
165
|
+
s([
|
|
76
166
|
r({ type: Number })
|
|
77
|
-
],
|
|
78
|
-
|
|
167
|
+
], e.prototype, "index", 2);
|
|
168
|
+
s([
|
|
79
169
|
r({ type: String })
|
|
80
|
-
],
|
|
81
|
-
|
|
170
|
+
], e.prototype, "description", 2);
|
|
171
|
+
s([
|
|
82
172
|
r({ type: Number })
|
|
83
|
-
],
|
|
84
|
-
|
|
173
|
+
], e.prototype, "state", 2);
|
|
174
|
+
s([
|
|
85
175
|
r({ type: Number })
|
|
86
|
-
],
|
|
87
|
-
|
|
176
|
+
], e.prototype, "selectedStepIndex", 2);
|
|
177
|
+
s([
|
|
88
178
|
r({ type: Boolean, reflect: !0 })
|
|
89
|
-
],
|
|
90
|
-
|
|
179
|
+
], e.prototype, "isSelected", 2);
|
|
180
|
+
s([
|
|
181
|
+
r({ type: Boolean })
|
|
182
|
+
], e.prototype, "isLast", 2);
|
|
183
|
+
s([
|
|
91
184
|
r({ type: Boolean })
|
|
92
|
-
],
|
|
93
|
-
|
|
185
|
+
], e.prototype, "entranceAllowed", 2);
|
|
186
|
+
s([
|
|
94
187
|
r({ type: Boolean })
|
|
95
|
-
],
|
|
96
|
-
s
|
|
97
|
-
|
|
98
|
-
],
|
|
188
|
+
], e.prototype, "disableClick", 2);
|
|
189
|
+
s([
|
|
190
|
+
r()
|
|
191
|
+
], e.prototype, "orientation", 2);
|
|
192
|
+
e = s([
|
|
193
|
+
p("nve-step")
|
|
194
|
+
], e);
|
|
99
195
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
196
|
+
C as StepState,
|
|
197
|
+
e as default
|
|
102
198
|
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { i as e } from "../../chunks/lit-element.js";
|
|
2
|
+
const r = e`
|
|
3
|
+
.mobile-stepper {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.progress-circle {
|
|
10
|
+
width: 50px;
|
|
11
|
+
height: 50px;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
border: 3px solid var(--feeedback-foreground-emphasized-success, #00814B);
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
margin-right: 16px;
|
|
19
|
+
padding: 0.2rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.step-info {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.step-title {
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.step-description {
|
|
33
|
+
color: var(--neutrals-foreground-primary, #0D0D0E);
|
|
34
|
+
|
|
35
|
+
/* Label/medium */
|
|
36
|
+
font-family: "Source Sans Pro";
|
|
37
|
+
font-size: 1.125rem; /*18px; */
|
|
38
|
+
font-style: normal;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
line-height: 110%;
|
|
41
|
+
padding-top: 0.75rem; /*12px;*/
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.next-button {
|
|
45
|
+
color: var(--neutrals-foreground-primary, #0D0D0E);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.back-button {
|
|
49
|
+
color: var(--neutrals-foreground-subtle, #60656C);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.step-buttons {
|
|
53
|
+
/* Label/small-light */
|
|
54
|
+
font-family: "Source Sans Pro";
|
|
55
|
+
font-size: 1rem; /*16px; */
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
line-height: 110%;
|
|
59
|
+
padding-top: 0.625rem; /*10px; */
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
export {
|
|
64
|
+
r as default
|
|
65
|
+
};
|