-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathStepNavigation.vue
93 lines (91 loc) · 1.94 KB
/
StepNavigation.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
<div class="step-navigation">
<v-button
v-if="stepName !== 'FS'"
class="is-border previous-button"
@click="handleNavigation('back')"
>
{{ $t('stepper.nav.previous-label') }}
</v-button>
<v-button
v-if="stepName !== 'AD'"
:class="['is-success', 'next-button', { disabled: !isNextEnabled }]"
:disabled="!isNextEnabled"
@click="handleNavigation('next')"
>
{{ $t('stepper.nav.next-label') }}
</v-button>
<v-button
v-else
class="is-success next-button done-button"
@click="handleDone"
>
{{ $t('stepper.nav.done-label') }}
</v-button>
<v-button
v-if="stepName === 'AD'"
class="restart-button is-text"
@click="handleRestart"
>
{{ $t('stepper.nav.restart-label') }}
</v-button>
</div>
</template>
<script>
export default {
name: 'StepNavigation',
props: {
stepName: {
type: String,
required: true,
},
isNextEnabled: {
type: Boolean,
default: false,
},
},
methods: {
handleNavigation(direction) {
this.$emit('navigate', { direction, name: this.stepName });
},
handleDone() {
this.$emit('done');
},
handleRestart() {
this.$emit('restart');
},
},
};
</script>
<style lang="scss">
@import '~@creativecommons/vocabulary-styles/dist/scss/color';
.step-navigation {
display: flex;
flex-direction: row;
align-items: center;
padding: 1.375rem 0 1.375rem 0;
width: 100%;
.button + .button {
margin-left: 1rem;
}
.button.restart-button {
margin-left: auto;
color: $color-forest-green;
}
.button.next-button.is-success {
background-color: $color-forest-green;
color: white;
&:hover,
&:active,
&:focus {
background-color: $color-brighter-forest-green;
}
}
}
@media only screen and (max-width: 768px) {
.step-navigation {
padding-right: 0;
padding-left: 0;
}
}
</style>