Skip to content

Commit

Permalink
Merge pull request #167 from Geode-solutions/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
JulienChampagnol authored Jan 27, 2025
2 parents da2ef2c + 599d83e commit 1573dbc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 52 deletions.
59 changes: 20 additions & 39 deletions components/Step.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<v-stepper-content :step="step_index + 1">
<v-row
align="center"
class="step-container"
class="mb-4 py-2"
@click="set_current_step(step_index)"
>
<v-col cols="auto" class="icon-container">
<v-col cols="auto" class="d-flex justify-center align-center">
<v-icon
v-if="current_step_index > step_index"
icon="mdi-check-circle"
Expand All @@ -22,25 +22,29 @@
color="grey"
/>
</v-col>
<v-col class="title-container">
<p class="step-title font-weight-bold">
<v-col>
<p class="m-0 font-weight-bold">
{{ steps[step_index].step_title }}
</p>
</v-col>
<v-col
<v-chip-group
v-if="
steps[step_index].chips.length && current_step_index >= step_index
"
class="chips-container"
column
class="d-flex flex-wrap ma-2 overflow-y-auto"
multiple
style="max-height: 150px"
>
<v-chip
v-for="(chip, chip_index) in steps[step_index].chips"
:key="chip_index"
class="step-chip"
class="ma-1"
:title="chip"
>
{{ chip }}
{{ truncate(chip, 50) }}
</v-chip>
</v-col>
</v-chip-group>
</v-row>
<component
v-if="step_index == current_step_index"
Expand All @@ -55,6 +59,13 @@
</template>

<script setup>
function truncate(text, maxLength) {
if (text.length > maxLength) {
return text.slice(0, maxLength) + "..."
}
return text
}
const props = defineProps({
step_index: { type: Number, required: true },
})
Expand All @@ -80,33 +91,3 @@
stepper_tree.current_step_index--
}
</script>

<style scoped>
.step-container {
margin-bottom: 16px;
padding: 8px;
}
.icon-container {
display: flex;
justify-content: center;
align-items: center;
}
.title-container {
margin-left: 8px;
}
.step-title {
margin: 0;
}
.chips-container {
display: flex;
gap: 4px;
}
.step-chip {
background-color: #f5f5f5;
}
</style>
22 changes: 9 additions & 13 deletions components/Stepper.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<template>
<v-stepper-vertical v-model="current_step_index" class="stepper-container">
<v-stepper-vertical
v-model="current_step_index"
class="pa-4 ma-0"
elevation="1"
rounded
>
<v-stepper-items>
<Step v-for="(step, index) in steps" :key="step" :step_index="index" />
<v-col cols="12">
<Step v-for="(step, index) in steps" :key="step" :step_index="index" />
</v-col>
</v-stepper-items>
</v-stepper-vertical>
</template>
Expand All @@ -10,14 +17,3 @@
const stepper_tree = inject("stepper_tree")
const { steps, current_step_index } = toRefs(stepper_tree)
</script>

<style scoped>
.stepper-container {
max-width: 600px;
margin: 0 auto;
padding: 16px;
background-color: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
</style>

0 comments on commit 1573dbc

Please sign in to comment.