From f16b42730319547fbc2084e210762fd22f333901 Mon Sep 17 00:00:00 2001 From: Enea Barbetta Date: Thu, 28 Feb 2019 19:07:12 +0100 Subject: [PATCH 1/3] Enable "next button" if step is completed. I must allow the users to review the previous steps of a form. Since the "can-continue" event is triggered by Vee Validate, if the form is correct the user must be able to continue after going back and deciding not to make changes at all. --- src/HorizontalStepper.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/HorizontalStepper.vue b/src/HorizontalStepper.vue index d3beaad..6e21e9b 100644 --- a/src/HorizontalStepper.vue +++ b/src/HorizontalStepper.vue @@ -151,6 +151,11 @@ export default { if (!back) { this.$emit("completed-step", this.previousStep); } + + if(this.steps[index].completed) { + this.canContinue = true; + } + } this.$emit("active-step", this.currentStep); }, From 415c15d3151aaba43e3074e5b386b4b4ffb1164c Mon Sep 17 00:00:00 2001 From: Enea Barbetta Date: Thu, 28 Feb 2019 19:30:42 +0100 Subject: [PATCH 2/3] Added "review" prop (default: false) The prop review can be applied to the horizontal-stepper component. If set to true, it always enable the "next" button if the step is complete. It's useful when giving a quick review to a previously completed (and correct) form. --- src/HorizontalStepper.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/HorizontalStepper.vue b/src/HorizontalStepper.vue index 6e21e9b..16203d0 100644 --- a/src/HorizontalStepper.vue +++ b/src/HorizontalStepper.vue @@ -94,6 +94,10 @@ export default { reset: { type: Boolean, default: false + }, + review: { + type: Boolean, + default: false } }, @@ -152,8 +156,10 @@ export default { this.$emit("completed-step", this.previousStep); } - if(this.steps[index].completed) { - this.canContinue = true; + if(this.review) { + if(this.steps[index].completed) { + this.canContinue = true; + } } } From 0dbafe5afda10855539bbc610cfe2f55120bc838 Mon Sep 17 00:00:00 2001 From: Enea Barbetta Date: Thu, 30 May 2019 17:50:27 +0200 Subject: [PATCH 3/3] Change color to red --- src/HorizontalStepper.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HorizontalStepper.scss b/src/HorizontalStepper.scss index faedcc9..8bccab4 100644 --- a/src/HorizontalStepper.scss +++ b/src/HorizontalStepper.scss @@ -57,8 +57,8 @@ align-items: center; justify-content: space-between; &.next { - border: 2px solid #3383c8; - color: #3383c8; + border: 2px solid #d80000; + color: #d80000; right: 1%; &.deactivated { border: 2px solid #cccccc !important; @@ -122,7 +122,7 @@ padding: 0 1rem; background-color: white; i { - background-color: #3383c8; + background-color: #d80000; color: #fff; border-radius: 100rem; padding: 1rem; @@ -171,7 +171,7 @@ align-items: center; justify-content: space-between; &.next { - background-color: #3383c8; + background-color: #d80000; color: white; @include shadow(1); &.deactivated { @@ -184,4 +184,4 @@ } } } -} \ No newline at end of file +}