| 1 |
<template> |
| 2 |
<div class="wpfnl-mm-setup-wizard-steps"> |
| 3 |
<div |
| 4 |
v-for="(step, index) in steps" |
| 5 |
:key="index" |
| 6 |
class="wpfnl-mm-setup-wizard-step" |
| 7 |
:class="{ |
| 8 |
'active': isActive(index), |
| 9 |
'completed': isCompleted(index) |
| 10 |
}" |
| 11 |
> |
| 12 |
<div class="wpfnl-mm-setup-wizard-step-number"> |
| 13 |
<svg v-if="isCompleted(index)" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">> |
| 14 |
<circle cx="8" cy="8" r="8" fill="#239654"/> |
| 15 |
<path d="M11.3333 5.33334L6.66667 10L4.66667 8" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> |
| 16 |
</svg> |
| 17 |
<span v-else>{{ index + 1 }}</span> |
| 18 |
</div> |
| 19 |
<span class="wpfnl-mm-setup-wizard-step-label">{{ step }}</span> |
| 20 |
</div> |
| 21 |
</div> |
| 22 |
</template> |
| 23 |
|
| 24 |
<script> |
| 25 |
export default { |
| 26 |
name: 'Steps', |
| 27 |
props: { |
| 28 |
currentStep: { |
| 29 |
type: Number, |
| 30 |
default: 1 |
| 31 |
}, |
| 32 |
selectedGoal: { |
| 33 |
type: String, |
| 34 |
default: '' |
| 35 |
}, |
| 36 |
storeCheckoutPhase: { |
| 37 |
type: String, |
| 38 |
default: 'select' |
| 39 |
} |
| 40 |
}, |
| 41 |
computed: { |
| 42 |
steps() { |
| 43 |
return ['Welcome', 'Required Installation', 'Store Checkout']; |
| 44 |
} |
| 45 |
}, |
| 46 |
methods: { |
| 47 |
isCompleted(index) { |
| 48 |
// Standard: earlier steps are completed when currentStep has moved past them |
| 49 |
if (this.currentStep > index + 1) return true; |
| 50 |
// Special case: step 3 (index 2) is completed when StoreCheckout phase is 'complete' |
| 51 |
if (index === 2 && this.currentStep === 3 && this.storeCheckoutPhase === 'complete') return true; |
| 52 |
return false; |
| 53 |
}, |
| 54 |
isActive(index) { |
| 55 |
// Step 3 is no longer "active" once it's complete — it's "completed" |
| 56 |
if (index === 2 && this.storeCheckoutPhase === 'complete') return false; |
| 57 |
return this.currentStep === index + 1; |
| 58 |
} |
| 59 |
} |
| 60 |
} |
| 61 |
</script> |
| 62 |
|