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

Commit c686975

Browse files
authored
Merge pull request #289 from charles-salmon/type-definitions
Improve Type Definitions
2 parents ff92af9 + 9bd176c commit c686975

File tree

7 files changed

+187
-35
lines changed

7 files changed

+187
-35
lines changed

dist/[object Object]

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/vue-form-wizard.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-form-wizard.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/FormWizard.ts

Lines changed: 124 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,144 @@
1+
import Vue from 'vue'
2+
13
export type ShapeType = 'circle' | 'square' | 'tab'
24
export type LayoutType = 'vertical' | 'horizontal'
35
export type StepSizeType = 'xs' | 'sm' | 'md' | 'lg'
46

5-
export declare class Wizard {
6-
/** Wizard title */
7+
export declare class Wizard extends Vue {
8+
/**
9+
* Wizard identifier.
10+
*
11+
* Default value: 'fw_<timestamp-in-milliseconds>'
12+
*/
13+
id: string
14+
15+
/**
16+
* Wizard title.
17+
*
18+
* Default value: 'Awesome Wizard'
19+
*/
720
title: string
8-
/** Wizard subtitle */
21+
22+
/**
23+
* Wizard subtitle.
24+
*
25+
* Default value: 'Split a complicated flow in multiple steps'
26+
*/
927
subtitle: string
28+
29+
/**
30+
* Text to display on next button.
31+
*
32+
* Default value: 'Next'
33+
*/
1034
nextButtonText: string
35+
36+
/**
37+
* Text to display on back button.
38+
*
39+
* Default value: 'Back'
40+
*/
1141
backButtonText: string
42+
43+
/**
44+
* Text to display on finish button.
45+
*
46+
* Default value: 'Finish'
47+
*/
1248
finishButtonText: string
13-
/** Whether to hide footer buttons */
49+
50+
/**
51+
* Whether or not buttons should be hidden.
52+
*
53+
* Default value: false
54+
*/
1455
hideButtons: boolean
15-
/** Whether to trigger beforeChange function when navigating back */
56+
57+
/**
58+
* Whether or not to trigger `beforeChange` function when navigating back.
59+
*
60+
* Default value: false
61+
*/
1662
validateOnBack: boolean
17-
/** Active step and button color */
63+
64+
/**
65+
* Color to apply to text, border and circle.
66+
*
67+
* Default value: '#e74c3c'
68+
*/
1869
color: string
19-
/** Step color when the current step is not valid */
70+
71+
/**
72+
* Step color when the current step is not valid.
73+
*
74+
* Default value: '#8b0000'
75+
*/
2076
errorColor: string
21-
/** Main step shape */
77+
78+
/**
79+
* Shape of steps.
80+
*
81+
* Default value: 'circle'
82+
*/
2283
shape: ShapeType
23-
/** Wizard layout */
84+
85+
/**
86+
* Layout of wizard.
87+
*
88+
* Default value: 'horizontal'
89+
*/
2490
layout: LayoutType
25-
/** Additional css classes for steps */
91+
92+
/**
93+
* Additional CSS classes to apply to steps.
94+
*
95+
* Default value: ''
96+
*/
2697
stepsClasses: string[]
27-
/** Step size */
98+
99+
/**
100+
* Size of steps.
101+
*
102+
* Default value: 'md'
103+
*/
28104
stepSize: StepSizeType
29-
/** Step transition from inactive to active */
105+
106+
/**
107+
* Name of the transition when transitioning between steps.
108+
*
109+
* Default value: ''
110+
*/
30111
transition: string
31-
/** Tab index where the wizard should start */
112+
113+
/**
114+
* Zero-based index of the initial tab to be displayed.
115+
*
116+
* Default value: 0
117+
*/
32118
startIndex: number
119+
120+
/**
121+
* Resets the wizard to its initial state.
122+
*/
123+
reset: () => void
124+
125+
/**
126+
* Activates all steps, as if the user has navigated to each of them.
127+
*/
128+
activateAll: () => void
129+
130+
/**
131+
* Navigates to the next tab.
132+
*/
133+
nextTab: () => void
134+
135+
/**
136+
* Navigates to the previous tab.
137+
*/
138+
prevTab: () => void
139+
140+
/**
141+
* Navigates from one tab to another. Note that this method does not trigger validaiton methods.
142+
*/
143+
changeTab: (oldIndex: number, newIndex: number, emitChangeEvent?: boolean) => boolean
33144
}

0 commit comments

Comments
 (0)