PluginProbe
Hostinger Tools / 3.0.38
Hostinger Tools v3.0.38
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / vue-frontend / src / components / Stepper.vue

Stepper.vue in Hostinger Tools 3.0.38, at vue-frontend/src/components/Stepper.vue

67 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <script setup lang="ts">
2 interface Props {
3 stepsCount: number;
4 isClickable?: boolean;
5 wide?: boolean;
6 step?: number;
7 }
8
9 type Emits = {
10 (eventName: 'on-click', index: number): void;
11 };
12
13 const props = withDefaults(defineProps<Props>(), {
14 stepsCount: 0,
15 isClickable: false,
16 wide: false,
17 step: 0
18 });
19
20 const emit = defineEmits<Emits>();
21
22 const getIsActive = (index: number, step: number) =>
23 (!props.isClickable && index <= step) || (props.isClickable && index === step);
24 </script>
25
26 <template>
27 <div class="stepper">
28 <div
29 v-for="(_, index) in stepsCount"
30 :key="index"
31 class="stepper__indicator"
32 :class="{
33 'stepper__indicator--active': getIsActive(index, step),
34 'stepper__indicator--clickable': isClickable,
35 'stepper__indicator--wide': wide
36 }"
37 @click="emit('on-click', index)"
38 />
39 </div>
40 </template>
41
42 <style lang="scss" scoped>
43 .stepper {
44 display: flex;
45 justify-content: center;
46 margin-top: 24px;
47
48 &__indicator {
49 width: 8px;
50 height: 8px;
51 margin-left: 4px;
52 border-radius: 50%;
53 background-color: rgba(114, 117, 134, 0.3);
54
55 &--wide {
56 margin: 0 8px;
57 }
58 &--active {
59 background-color: var(--primary);
60 }
61 &--clickable {
62 cursor: pointer;
63 }
64 }
65 }
66 </style>
67