Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
#22 Initial support for vertical tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
cristijora committed Sep 27, 2017
1 parent 74f04a5 commit 0cdc048
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
7 changes: 6 additions & 1 deletion dev-example/WizardRoute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<form-wizard @on-complete="onComplete"
@on-change="handleChange"
:start-index.sync="activeIndex"
shape="tab"
layout="vertical"
steps-classes="steps-size"
color="#e74c3c">
<tab-content v-for="tab in tabs" :title="tab" :key="tab">{{tab}}</tab-content>
<transition name="fade" mode="out-in">
Expand Down Expand Up @@ -66,6 +67,10 @@
@import "loader.css";
</style>
<style lang="scss">
.steps-size{
width: 200px;
height: 400px;
}
$border-radius-extreme: 6px !default;
$white-color: white;
$gray-input-bg: #F3F2EE !default;
Expand Down
17 changes: 17 additions & 0 deletions src/assets/form-wizard/_wizard-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,21 @@
}
}
}

&.vertical {
.wizard-card-footer {
display: block;
}
.wizard-nav-pills {
flex-direction: column;
}
.wizard-navigation {
display: flex;
flex-direction: row;
}
.wizard-card-footer {
padding-top: 30px;

}
}
}
17 changes: 14 additions & 3 deletions src/components/FormWizard.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<div class="vue-form-wizard" :class="stepSize" @keyup.right="focusNextTab" @keyup.left="focusPrevTab">
<div class="vue-form-wizard" :class="[stepSize, {vertical: isVertical}]" @keyup.right="focusNextTab" @keyup.left="focusPrevTab">
<div class="wizard-header">
<slot name="title">
<h4 class="wizard-title">{{title}}</h4>
<p class="category">{{subtitle}}</p>
</slot>
</div>
<div class="wizard-navigation">
<div class="wizard-progress-with-circle">
<div class="wizard-progress-with-circle" v-if="!isVertical">
<div class="wizard-progress-bar"
:style="progressBarStyle"></div>
</div>
<ul class="wizard-nav wizard-nav-pills" role="tablist">
<ul class="wizard-nav wizard-nav-pills" role="tablist" :class="stepsClasses">
<slot name="step" v-for="(tab, index) in tabs"
:tab="tab"
:index="index"
Expand Down Expand Up @@ -122,6 +122,14 @@
type: String,
default: 'circle'
},
layout: {
type: String,
default: 'horizontal'
},
stepsClasses: {
type: [String, Array],
default: ''
},
stepSize: {
type: String,
default: 'md',
Expand Down Expand Up @@ -174,6 +182,9 @@
isLastStep () {
return this.activeTabIndex === this.tabCount - 1
},
isVertical () {
return this.layout === 'vertical'
},
displayPrevButton () {
return this.activeTabIndex !== 0
},
Expand Down

0 comments on commit 0cdc048

Please sign in to comment.