Skip to content

Commit 1573dbc

Browse files
Merge pull request #167 from Geode-solutions/next
Next
2 parents da2ef2c + 599d83e commit 1573dbc

File tree

2 files changed

+29
-52
lines changed

2 files changed

+29
-52
lines changed

components/Step.vue

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<v-stepper-content :step="step_index + 1">
33
<v-row
44
align="center"
5-
class="step-container"
5+
class="mb-4 py-2"
66
@click="set_current_step(step_index)"
77
>
8-
<v-col cols="auto" class="icon-container">
8+
<v-col cols="auto" class="d-flex justify-center align-center">
99
<v-icon
1010
v-if="current_step_index > step_index"
1111
icon="mdi-check-circle"
@@ -22,25 +22,29 @@
2222
color="grey"
2323
/>
2424
</v-col>
25-
<v-col class="title-container">
26-
<p class="step-title font-weight-bold">
25+
<v-col>
26+
<p class="m-0 font-weight-bold">
2727
{{ steps[step_index].step_title }}
2828
</p>
2929
</v-col>
30-
<v-col
30+
<v-chip-group
3131
v-if="
3232
steps[step_index].chips.length && current_step_index >= step_index
3333
"
34-
class="chips-container"
34+
column
35+
class="d-flex flex-wrap ma-2 overflow-y-auto"
36+
multiple
37+
style="max-height: 150px"
3538
>
3639
<v-chip
3740
v-for="(chip, chip_index) in steps[step_index].chips"
3841
:key="chip_index"
39-
class="step-chip"
42+
class="ma-1"
43+
:title="chip"
4044
>
41-
{{ chip }}
45+
{{ truncate(chip, 50) }}
4246
</v-chip>
43-
</v-col>
47+
</v-chip-group>
4448
</v-row>
4549
<component
4650
v-if="step_index == current_step_index"
@@ -55,6 +59,13 @@
5559
</template>
5660

5761
<script setup>
62+
function truncate(text, maxLength) {
63+
if (text.length > maxLength) {
64+
return text.slice(0, maxLength) + "..."
65+
}
66+
return text
67+
}
68+
5869
const props = defineProps({
5970
step_index: { type: Number, required: true },
6071
})
@@ -80,33 +91,3 @@
8091
stepper_tree.current_step_index--
8192
}
8293
</script>
83-
84-
<style scoped>
85-
.step-container {
86-
margin-bottom: 16px;
87-
padding: 8px;
88-
}
89-
90-
.icon-container {
91-
display: flex;
92-
justify-content: center;
93-
align-items: center;
94-
}
95-
96-
.title-container {
97-
margin-left: 8px;
98-
}
99-
100-
.step-title {
101-
margin: 0;
102-
}
103-
104-
.chips-container {
105-
display: flex;
106-
gap: 4px;
107-
}
108-
109-
.step-chip {
110-
background-color: #f5f5f5;
111-
}
112-
</style>

components/Stepper.vue

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<template>
2-
<v-stepper-vertical v-model="current_step_index" class="stepper-container">
2+
<v-stepper-vertical
3+
v-model="current_step_index"
4+
class="pa-4 ma-0"
5+
elevation="1"
6+
rounded
7+
>
38
<v-stepper-items>
4-
<Step v-for="(step, index) in steps" :key="step" :step_index="index" />
9+
<v-col cols="12">
10+
<Step v-for="(step, index) in steps" :key="step" :step_index="index" />
11+
</v-col>
512
</v-stepper-items>
613
</v-stepper-vertical>
714
</template>
@@ -10,14 +17,3 @@
1017
const stepper_tree = inject("stepper_tree")
1118
const { steps, current_step_index } = toRefs(stepper_tree)
1219
</script>
13-
14-
<style scoped>
15-
.stepper-container {
16-
max-width: 600px;
17-
margin: 0 auto;
18-
padding: 16px;
19-
background-color: #f9f9f9;
20-
border-radius: 8px;
21-
border: 1px solid #e0e0e0;
22-
}
23-
</style>

0 commit comments

Comments
 (0)