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

Allow to add pack's icons #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/TabContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
type: String,
default: ''
},
/***
* Icon pack name corresponding
*/
iconPack: {
default: '',
type: String
},
/***
* Function to execute before tab switch. Return value must be boolean
* If the return result is false, tab switch is restricted
Expand Down
8 changes: 6 additions & 2 deletions src/components/WizardStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
:class="{square_shape:isStepSquare, tab_shape:isTabShape}"
:style="[tab.active ? iconActiveStyle: {}, tab.validationError ? errorStyle : {}]">
<slot name="active-step">
<i v-if="tab.icon" :class="tab.icon" class="wizard-icon"></i>
<i v-if="tab.icon" :class="[tab.iconPack, tab.iconPack !== 'material-icons' ? tab.icon : '']" class="wizard-icon">
{{ tab.iconPack === 'material-icons' ? icon : '' }}
</i>
<i v-else class="wizard-icon">{{index + 1}}</i>
</slot>
</div>
<slot v-if="!tab.active">
<i v-if="!tab.active && tab.icon" :class="tab.icon" class="wizard-icon"></i>
<i v-if="!tab.active && tab.icon" :class="[tab.iconPack, tab.iconPack !== 'material-icons' ? tab.icon : '']" class="wizard-icon">
{{ tab.iconPack === 'material-icons' ? icon : '' }}
</i>
<i v-if="!tab.active && !tab.icon" class="wizard-icon">{{index + 1}}</i>
</slot>
</transition>
Expand Down
12 changes: 9 additions & 3 deletions types/TabContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ import Vue from 'vue'
export declare class Tab extends Vue {
/**
* Title to be displayed under each step.
*
*
* Default value: ''
*/
title: string

/** CSS class to be applied to each step icon.
*
*
* Default value: ''
*/
icon: string

/** Icon pack name corresponding.
*
* Default value: ''
*/
iconPack: string

/**
* Function to execute before changing tabs. If the return result is false, the tab switch is restricted.
*/
Expand Down