2023-03-17 15:13:37 +00:00
|
|
|
<template>
|
|
|
|
<div class="flex items-center relative">
|
2024-10-31 10:02:36 +00:00
|
|
|
<!-- The main circular icon with dynamic classes based on the state of the step -->
|
|
|
|
<div class="text-gray-500 rounded-full transition duration-500 ease-in-out h-12 w-12 py-3 border-2"
|
|
|
|
:class="[
|
|
|
|
isCurrent ? 'text-white bg-teal-600 border-teal-600' : 'border-gray-300',
|
|
|
|
isChecked && 'text-teal-600 border-teal-600',
|
|
|
|
]">
|
|
|
|
<!-- Slot for custom content inside the circle -->
|
2023-03-17 15:13:37 +00:00
|
|
|
<slot></slot>
|
2024-10-31 10:02:36 +00:00
|
|
|
<!-- Label displayed above the icon, visibility controlled by isCurrent and isDark -->
|
|
|
|
<div class="absolute top-0 -ml-10 text-center mt-16 w-32 text-xs font-medium uppercase invisible sm:visible"
|
|
|
|
:class="[!isDark && isCurrent ? 'font-black text-green-600' : '']">
|
2023-03-17 15:13:37 +00:00
|
|
|
{{ label }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-10-31 10:02:36 +00:00
|
|
|
<!-- Divider line between steps, only visible if this is not the last step -->
|
|
|
|
<div v-if="!isLastStep" class="flex-auto border-t-2 transition duration-500 ease-in-out invisible sm:visible"
|
|
|
|
:class="[isChecked ? 'border-teal-600' : 'border-gray-300']"></div>
|
2023-03-17 15:13:37 +00:00
|
|
|
</template>
|
|
|
|
|
2024-10-31 10:02:36 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { StyleService } from '@/Stores/style.service';
|
|
|
|
|
|
|
|
const styleService = StyleService();
|
|
|
|
|
2023-03-17 15:13:37 +00:00
|
|
|
export default {
|
|
|
|
name: 'Icon_Multistep',
|
|
|
|
props: {
|
2024-10-31 10:02:36 +00:00
|
|
|
isCurrent: Boolean, // Indicates if this step is the current one
|
|
|
|
isChecked: Boolean, // Indicates if this step has been checked
|
|
|
|
isLastStep: Boolean, // Indicates if this step is the last one
|
|
|
|
label: String, // Label to display above the icon
|
2023-03-17 15:13:37 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2024-10-31 10:02:36 +00:00
|
|
|
mode: 'light', // Light mode setting
|
|
|
|
checkedClass: 'border-teal-600', // Class for checked state
|
|
|
|
uncheckedClass: 'border-gray-300', // Class for unchecked state
|
2023-03-17 15:13:37 +00:00
|
|
|
};
|
|
|
|
},
|
2024-10-31 10:02:36 +00:00
|
|
|
computed: {
|
|
|
|
// Computed property to determine if dark mode is enabled
|
|
|
|
isDark() {
|
|
|
|
return styleService.darkMode === true; // Return true if dark mode is active
|
|
|
|
}
|
|
|
|
},
|
2023-03-17 15:13:37 +00:00
|
|
|
};
|
|
|
|
</script>
|