mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-23 23:00:34 +03:00
#39 Support sizing step indicators
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
@import "mixins/wizard-size";
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
.vue-form-wizard {
|
.vue-form-wizard {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
.is_error {
|
.is_error {
|
||||||
@@ -6,6 +9,11 @@
|
|||||||
background: $danger-states-color !important;
|
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 {
|
.wizard-icon-circle {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
border: 3px solid $gray-input-bg;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="vue-form-wizard">
|
<div class="vue-form-wizard" :class="stepSize">
|
||||||
<div class="wizard-header">
|
<div class="wizard-header">
|
||||||
<slot name="title">
|
<slot name="title">
|
||||||
<h4 class="wizard-title">{{title}}</h4>
|
<h4 class="wizard-title">{{title}}</h4>
|
||||||
@@ -16,8 +16,10 @@
|
|||||||
:tab="tab"
|
:tab="tab"
|
||||||
:index="index"
|
:index="index"
|
||||||
:navigate-to-tab="navigateToTab"
|
:navigate-to-tab="navigateToTab"
|
||||||
|
:step-size="stepSize"
|
||||||
:transition="transition">
|
:transition="transition">
|
||||||
<wizard-step :tab="tab"
|
<wizard-step :tab="tab"
|
||||||
|
:step-size="stepSize"
|
||||||
@click.native="navigateToTab(index)"
|
@click.native="navigateToTab(index)"
|
||||||
:transition="transition"
|
:transition="transition"
|
||||||
:index="index">
|
:index="index">
|
||||||
@@ -25,7 +27,7 @@
|
|||||||
</slot>
|
</slot>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="wizard-tab-content">
|
<div class="wizard-tab-content">
|
||||||
<slot>
|
<slot v-bind="slotProps">
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -118,6 +120,14 @@
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'circle'
|
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
|
* Name of the transition when transition between steps
|
||||||
* */
|
* */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<li :class="{active:tab.active}">
|
<li :class="{active:tab.active}">
|
||||||
<a>
|
<a>
|
||||||
<div class="wizard-icon-circle"
|
<div class="wizard-icon-circle md"
|
||||||
:class="{checked: tab.checked,square_shape:isStepSquare, tab_shape:isTabShape}"
|
:class="{checked: tab.checked,square_shape:isStepSquare, tab_shape:isTabShape}"
|
||||||
:style="[tab.checked ? stepCheckedStyle : {}, tab.validationError ? errorStyle : {}]">
|
:style="[tab.checked ? stepCheckedStyle : {}, tab.validationError ? errorStyle : {}]">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user