Skip to content

Commit 390b176

Browse files
Format the file
1 parent b73a4bf commit 390b176

File tree

1 file changed

+56
-23
lines changed

1 file changed

+56
-23
lines changed

src/MasterForm.svelte

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<script>
2-
import { onMount, afterUpdate } from "svelte";
3-
import { currentStep } from "./stores.js";
2+
import {
3+
onMount,
4+
afterUpdate
5+
} from "svelte";
6+
import {
7+
currentStep
8+
} from "./stores.js";
49
import {
510
uuidv4,
611
formHasError,
@@ -12,27 +17,32 @@
1217
export let resetSteps;
1318
1419
let defaultStepOptions = {
15-
formTitle : 'Hello world',
16-
formSubtitle : 'Welcome to our world',
17-
formMethodType : 'POST',
18-
prevMessageText : 'Previous',
19-
nextMessageText : 'Next',
20-
formActionURL:'/',
21-
formID : 's-multistep-form',
22-
displayIndex : true,
23-
svgCircleColor : "#48DB71",
24-
selectCircleColor : "red",
25-
selectboxShadowCircleColor : "#48DB71",
26-
unselectboxShadowCircleColor : "#48DB71",
27-
indexblanckColor : 'black',
28-
indexColor : 'black',
29-
stepsDescription: [
30-
{ title: "STEP 1", subtitle: "All the details to perform on this step" },
31-
{ title: "STEP 2", subtitle: "All the details to perform on this step" }
20+
formTitle: 'Hello world',
21+
formSubtitle: 'Welcome to our world',
22+
formMethodType: 'POST',
23+
prevMessageText: 'Previous',
24+
nextMessageText: 'Next',
25+
formActionURL: '/',
26+
formID: 's-multistep-form',
27+
displayIndex: true,
28+
svgCircleColor: "#48DB71",
29+
selectCircleColor: "red",
30+
selectboxShadowCircleColor: "#48DB71",
31+
unselectboxShadowCircleColor: "#48DB71",
32+
indexblanckColor: 'black',
33+
indexColor: 'black',
34+
stepsDescription: [{
35+
title: "STEP 1",
36+
subtitle: "All the details to perform on this step"
37+
},
38+
{
39+
title: "STEP 2",
40+
subtitle: "All the details to perform on this step"
41+
}
3242
]
3343
}
3444
35-
multiStepOptions = Object.assign({}, defaultStepOptions, multiStepOptions)
45+
multiStepOptions = Object.assign({}, defaultStepOptions, multiStepOptions)
3646
3747
/*
3848
Lifecycle Hooks
@@ -48,7 +58,7 @@
4858
step.classList.add("step-is-active");
4959
}
5060
});
51-
61+
5262
updateButtonVisibility();
5363
});
5464
@@ -77,30 +87,37 @@
7787
updateStepStatus(currentStep.decrement);
7888
}
7989
};
90+
8091
</script>
8192

8293
<style>
8394
.name {
8495
color: #848383;
8596
}
97+
8698
.subtitle {
8799
color: rgb(223, 219, 219);
88100
display: block;
89101
}
102+
90103
.multistep-form {
91104
display: flex;
92105
}
106+
93107
.separator,
94108
.multistep-left-sidebar {
95109
flex: 1;
96110
}
111+
97112
.multistep-right-sidebar {
98113
flex: 3;
99114
text-align: left;
100115
}
116+
101117
.multistep-continue-button {
102118
float: right;
103119
}
120+
104121
.separator-check {
105122
width: 15px;
106123
height: 20px;
@@ -110,6 +127,7 @@
110127
padding: 11px 10px 2px;
111128
z-index: 10;
112129
}
130+
113131
.separator-check-pending {
114132
width: 15px;
115133
height: 20px;
@@ -119,6 +137,7 @@
119137
padding: 11px 10px 2px;
120138
z-index: 10;
121139
}
140+
122141
.separator-check-current {
123142
width: 15px;
124143
height: 20px;
@@ -129,36 +148,44 @@
129148
z-index: 10;
130149
box-shadow: 0px 1px 8px #5e40db;
131150
}
151+
132152
.separator-check-number {
133153
color: white;
134154
text-align: center;
135155
margin-top: -3px;
136156
}
157+
137158
.separator-check-number-blank {
138159
text-align: center;
139160
margin-top: -3px;
140161
}
162+
141163
.separator-line {
142164
border-right: 2px solid #ccc;
143165
margin: 0 auto;
144166
position: relative;
145-
height: 40px; /* placeholder, should be displayed dynamically*/
167+
height: 40px;
168+
/* placeholder, should be displayed dynamically*/
146169
width: 1px;
147170
margin-bottom: 2px;
148171
margin-top: 2px;
149172
}
173+
150174
.multistep-master-form {
151175
padding: 30px;
152176
height: 100%;
153177
}
178+
154179
#multistep-prev {
155180
cursor: pointer;
156181
margin-right: 20px;
157182
}
183+
158184
#multistep-next {
159185
cursor: pointer;
160186
margin-left: 20px;
161187
}
188+
162189
.dot {
163190
height: 8px;
164191
width: 8px;
@@ -168,21 +195,25 @@
168195
margin-left: -2px;
169196
margin-top: 18px;
170197
}
198+
171199
.multistep-title-side {
172200
margin-top: 40px;
173201
text-align: right;
174202
}
203+
175204
.multistep-form-title {
176205
text-align: left;
177206
color: #636262;
178207
font-weight: bold;
179208
}
209+
180210
.multistep-form-subtitle {
181211
text-align: left;
182212
color: rgb(223, 219, 219);
183213
margin-bottom: 30px;
184214
font-weight: lighter;
185215
}
216+
186217
#multistep-error-messages {
187218
position: absolute;
188219
right: 0;
@@ -196,13 +227,15 @@
196227
opacity: 0;
197228
transition: visibility 0s, opacity 0.2s linear;
198229
}
230+
199231
</style>
200232

201233
<div class="multistep-master-form">
202234
<div id="multistep-error-messages" />
203235
<h1 class="multistep-form-title">{multiStepOptions.formTitle}</h1>
204236
<h5 class="multistep-form-subtitle">{multiStepOptions.formSubtitle}</h5>
205-
<form class="multistep-form" id="{multiStepOptions.formID}" method="{multiStepOptions.formMethodType}" action="{multiStepOptions.formActionURL}">
237+
<form class="multistep-form" id="{multiStepOptions.formID}" method="{multiStepOptions.formMethodType}"
238+
action="{multiStepOptions.formActionURL}">
206239
<div class="multistep-left-sidebar">
207240
{#each multiStepOptions.stepsDescription as step}
208241
<div class="multistep-title-side">

0 commit comments

Comments
 (0)