2
0
mirror of https://github.com/tenrok/vue-form-wizard.git synced 2026-06-10 18:52:24 +03:00

#39 Support sizing step indicators

This commit is contained in:
cristijora
2017-09-04 19:45:56 +03:00
parent 218d38f7cb
commit d7b39624d3
4 changed files with 43 additions and 3 deletions
+8
View File
@@ -1,3 +1,6 @@
@import "mixins/wizard-size";
@import "variables";
.vue-form-wizard {
padding-bottom: 20px;
.is_error {
@@ -6,6 +9,11 @@
background: $danger-states-color !important;
}
}
@include wizard-size('xs', 40px, 16px);
@include wizard-size('sm', 50px, 20px);
@include wizard-size('md', 70px, 24px);
@include wizard-size('lg', 90px, 28px);
.wizard-icon-circle {
font-size: 18px;
border: 3px solid $gray-input-bg;
@@ -0,0 +1,22 @@
@mixin wizard-size($name, $size, $font-size){
$computed-font-size: $size/2 + 5px;
&.#{$name}{
.wizard-icon-circle{
width: $size;
height: $size;
font-size: $font-size;
&.tab_shape {
height: $computed-font-size;
}
}
.wizard-nav-pills > li.active > a .wizard-icon {
font-size: $font-size;
}
.wizard-navigation .wizard-progress-with-circle {
position: relative;
top: $computed-font-size;
height: 4px;
}
}
}
+12 -2
View File
@@ -1,5 +1,5 @@
<template>
<div class="vue-form-wizard">
<div class="vue-form-wizard" :class="stepSize">
<div class="wizard-header">
<slot name="title">
<h4 class="wizard-title">{{title}}</h4>
@@ -16,8 +16,10 @@
:tab="tab"
:index="index"
:navigate-to-tab="navigateToTab"
:step-size="stepSize"
:transition="transition">
<wizard-step :tab="tab"
:step-size="stepSize"
@click.native="navigateToTab(index)"
:transition="transition"
:index="index">
@@ -25,7 +27,7 @@
</slot>
</ul>
<div class="wizard-tab-content">
<slot>
<slot v-bind="slotProps">
</slot>
</div>
</div>
@@ -118,6 +120,14 @@
type: String,
default: 'circle'
},
stepSize: {
type: String,
default: 'md',
validator: (value) => {
let acceptedValues = ['xs', 'sm', 'md', 'lg']
return acceptedValues.indexOf(value) !== -1
}
},
/**
* Name of the transition when transition between steps
* */
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<li :class="{active:tab.active}">
<a>
<div class="wizard-icon-circle"
<div class="wizard-icon-circle md"
:class="{checked: tab.checked,square_shape:isStepSquare, tab_shape:isTabShape}"
:style="[tab.checked ? stepCheckedStyle : {}, tab.validationError ? errorStyle : {}]">