PluginProbe
Hostinger Tools / trunk
Hostinger Tools vtrunk
3.0.78 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 All 109 releases
hostinger / vue-frontend / src / components / Stepper.vue

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

68 lines 1.2 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 "on-click": [index: number];
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) ||
24 (props.isClickable && index === step);
25 </script>
26
27 <template>
28 <div class="stepper">
29 <div
30 v-for="(_, index) in stepsCount"
31 :key="index"
32 class="stepper__indicator"
33 :class="{
34 'stepper__indicator--active': getIsActive(index, step),
35 'stepper__indicator--clickable': isClickable,
36 'stepper__indicator--wide': wide,
37 }"
38 @click="emit('on-click', index)"
39 />
40 </div>
41 </template>
42
43 <style lang="scss" scoped>
44 .stepper {
45 display: flex;
46 justify-content: center;
47 margin-top: 24px;
48
49 &__indicator {
50 width: 8px;
51 height: 8px;
52 margin-left: 4px;
53 border-radius: 50%;
54 background-color: rgba(114, 117, 134, 0.3);
55
56 &--wide {
57 margin: 0 8px;
58 }
59 &--active {
60 background-color: var(--primary);
61 }
62 &--clickable {
63 cursor: pointer;
64 }
65 }
66 }
67 </style>
68