@smart-wizard/vue 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +64 -2
- package/dist/index.d.mts +427 -0
- package/dist/index.d.ts +427 -0
- package/dist/index.js +84 -0
- package/dist/index.mjs +57 -0
- package/package.json +57 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dipu Rajendran
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @smart-wizard/vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Official Vue 3 adapter for SmartWizard.**
|
|
4
|
+
Composable (`useSmartWizard`) with reactive step info, controls, and loading state.
|
|
5
|
+
|
|
6
|
+
> This package is part of the **[SmartWizard](https://github.com/techlab/smart-wizard)** project, the next-generation continuation of the popular jQuery SmartWizard.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 📖 Documentation & Links
|
|
11
|
+
|
|
12
|
+
* 📚 **Full Vue Documentation & Examples**: [GitHub Readme](https://github.com/techlab/smart-wizard#-vue-adapter)
|
|
13
|
+
* 🌐 **Official Website & Demos**: [techlaboratory.net/smart-wizard](https://techlaboratory.net/smart-wizard)
|
|
14
|
+
* 🐙 **Repository**: [github.com/techlab/smart-wizard](https://github.com/techlab/smart-wizard)
|
|
15
|
+
* 🐛 **Issue Tracker**: [github.com/techlab/smart-wizard/issues](https://github.com/techlab/smart-wizard/issues)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 📥 Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @smart-wizard/vue @smart-wizard/core @smart-wizard/ui
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ⚡ Quick Example
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<template>
|
|
31
|
+
<div ref="wizardRef" id="wizard">
|
|
32
|
+
<nav class="sw-nav" role="tablist">
|
|
33
|
+
<div class="sw-nav-item" role="tab"><span class="title">Step 1</span></div>
|
|
34
|
+
<div class="sw-nav-item" role="tab"><span class="title">Step 2</span></div>
|
|
35
|
+
</nav>
|
|
36
|
+
<div class="sw-panels">
|
|
37
|
+
<section class="sw-panel" id="step-1" role="tabpanel">Step 1 Content</section>
|
|
38
|
+
<section class="sw-panel" id="step-2" role="tabpanel">Step 2 Content</section>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="sw-toolbar">
|
|
41
|
+
<button @click="prev">Back</button>
|
|
42
|
+
<button @click="next">Next</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { ref } from 'vue';
|
|
49
|
+
import { useSmartWizard } from '@smart-wizard/vue';
|
|
50
|
+
import '@smart-wizard/ui/full';
|
|
51
|
+
import '@smart-wizard/ui/themes/arrows.css';
|
|
52
|
+
|
|
53
|
+
const wizardRef = ref<HTMLElement | null>(null);
|
|
54
|
+
const { next, prev, stepInfo } = useSmartWizard(wizardRef, {
|
|
55
|
+
theme: 'arrows',
|
|
56
|
+
transition: { effect: 'slideHorizontal' },
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📝 License
|
|
64
|
+
|
|
65
|
+
Dual-licensed under [MIT](https://github.com/techlab/smart-wizard/blob/main/LICENSE) (open-source) and [Commercial License](https://techlaboratory.net/smart-wizard#license).
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import * as _smart_wizard_core from '@smart-wizard/core';
|
|
4
|
+
import { WizardOptions, WizardInfo, SmartWizard } from '@smart-wizard/core';
|
|
5
|
+
|
|
6
|
+
declare function useSmartWizard(containerRef: Ref<HTMLElement | null>, options: Partial<WizardOptions>): {
|
|
7
|
+
info: Ref<{
|
|
8
|
+
stepInfo: {
|
|
9
|
+
currentStep: number;
|
|
10
|
+
totalSteps: number;
|
|
11
|
+
};
|
|
12
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
13
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
14
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}, WizardInfo | {
|
|
18
|
+
stepInfo: {
|
|
19
|
+
currentStep: number;
|
|
20
|
+
totalSteps: number;
|
|
21
|
+
};
|
|
22
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
23
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
24
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}>;
|
|
28
|
+
stepInfo: vue.ComputedRef<{
|
|
29
|
+
currentStep: number;
|
|
30
|
+
totalSteps: number;
|
|
31
|
+
}>;
|
|
32
|
+
next: () => void | undefined;
|
|
33
|
+
prev: () => void | undefined;
|
|
34
|
+
first: () => void | undefined;
|
|
35
|
+
last: () => void | undefined;
|
|
36
|
+
goTo: (index: number, force?: boolean) => void | undefined;
|
|
37
|
+
reset: () => void | undefined;
|
|
38
|
+
destroy: () => void | undefined;
|
|
39
|
+
setOptions: (opts: Parameters<NonNullable<{
|
|
40
|
+
readonly main: HTMLElement;
|
|
41
|
+
container: HTMLElement;
|
|
42
|
+
stepItems: {
|
|
43
|
+
step: HTMLElement;
|
|
44
|
+
page: HTMLElement;
|
|
45
|
+
}[];
|
|
46
|
+
readonly id: string;
|
|
47
|
+
extend: (...exts: _smart_wizard_core.WizardExtension[]) => SmartWizard;
|
|
48
|
+
readonly activeIndex: number;
|
|
49
|
+
readonly stepLength: number;
|
|
50
|
+
step: (index: number) => _smart_wizard_core.WizardStep;
|
|
51
|
+
steps: (indexes?: number[]) => _smart_wizard_core.WizardStepCollection;
|
|
52
|
+
readonly activeStep: {
|
|
53
|
+
readonly index: number;
|
|
54
|
+
readonly element: HTMLElement;
|
|
55
|
+
readonly page: HTMLElement;
|
|
56
|
+
hasState: (state: _smart_wizard_core.StepState) => boolean;
|
|
57
|
+
isActive: () => boolean;
|
|
58
|
+
isDisabled: () => boolean;
|
|
59
|
+
isCompleted: () => boolean;
|
|
60
|
+
isHidden: () => boolean;
|
|
61
|
+
state: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
62
|
+
removeState: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
63
|
+
reset: () => _smart_wizard_core.WizardStep;
|
|
64
|
+
disable: () => _smart_wizard_core.WizardStep;
|
|
65
|
+
enable: () => _smart_wizard_core.WizardStep;
|
|
66
|
+
complete: () => _smart_wizard_core.WizardStep;
|
|
67
|
+
warning: () => _smart_wizard_core.WizardStep;
|
|
68
|
+
error: () => _smart_wizard_core.WizardStep;
|
|
69
|
+
show: () => _smart_wizard_core.WizardStep;
|
|
70
|
+
hide: () => _smart_wizard_core.WizardStep;
|
|
71
|
+
};
|
|
72
|
+
readonly progress: number;
|
|
73
|
+
readonly canGoNext: boolean;
|
|
74
|
+
readonly canGoPrev: boolean;
|
|
75
|
+
readonly options: {
|
|
76
|
+
readonly initialStep: number;
|
|
77
|
+
readonly theme: string;
|
|
78
|
+
readonly colorScheme: _smart_wizard_core.ColorScheme;
|
|
79
|
+
readonly layout: _smart_wizard_core.WizardLayout;
|
|
80
|
+
readonly color: _smart_wizard_core.WizardColor;
|
|
81
|
+
readonly behavior: {
|
|
82
|
+
autoHeight: boolean;
|
|
83
|
+
useUrlHash: boolean;
|
|
84
|
+
supportBrowserHistory: boolean;
|
|
85
|
+
};
|
|
86
|
+
readonly navigation: {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
alwaysClickable: boolean;
|
|
89
|
+
completed: {
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
completeAllPreviousSteps: boolean;
|
|
92
|
+
clearOnBack: boolean;
|
|
93
|
+
clickable: boolean;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
readonly transition: {
|
|
97
|
+
effect: "default" | "none" | "fade" | "slideHorizontal" | "slideVertical" | "slideSwing" | "css" | string;
|
|
98
|
+
speed: number;
|
|
99
|
+
easing: string;
|
|
100
|
+
css: {
|
|
101
|
+
prefix: string;
|
|
102
|
+
forward: {
|
|
103
|
+
show: string;
|
|
104
|
+
hide: string;
|
|
105
|
+
};
|
|
106
|
+
backward: {
|
|
107
|
+
show: string;
|
|
108
|
+
hide: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly keyboardNavigation: {
|
|
113
|
+
enabled: boolean;
|
|
114
|
+
keys: {
|
|
115
|
+
left: string[];
|
|
116
|
+
right: string[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
readonly stepStates: {
|
|
120
|
+
completed: number[];
|
|
121
|
+
disabled: number[];
|
|
122
|
+
hidden: number[];
|
|
123
|
+
error: number[];
|
|
124
|
+
warning: number[];
|
|
125
|
+
};
|
|
126
|
+
readonly swipeNavigation: {
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
threshold: number;
|
|
129
|
+
};
|
|
130
|
+
readonly scrollToView: boolean;
|
|
131
|
+
readonly contentLoader: _smart_wizard_core.ContentLoader | null;
|
|
132
|
+
};
|
|
133
|
+
readonly width: number;
|
|
134
|
+
readonly height: number;
|
|
135
|
+
readonly info: {
|
|
136
|
+
stepInfo: {
|
|
137
|
+
currentStep: number;
|
|
138
|
+
totalSteps: number;
|
|
139
|
+
};
|
|
140
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
141
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
142
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
143
|
+
width: number;
|
|
144
|
+
height: number;
|
|
145
|
+
};
|
|
146
|
+
next: () => void;
|
|
147
|
+
prev: () => void;
|
|
148
|
+
first: () => void;
|
|
149
|
+
last: () => void;
|
|
150
|
+
goTo: (stepIndex: number, options?: {
|
|
151
|
+
force?: boolean;
|
|
152
|
+
}) => void;
|
|
153
|
+
reset: () => void;
|
|
154
|
+
setOptions: (options: Partial<WizardOptions>) => void;
|
|
155
|
+
getOptions: () => WizardOptions;
|
|
156
|
+
readonly loader: {
|
|
157
|
+
show: () => void;
|
|
158
|
+
hide: () => void;
|
|
159
|
+
};
|
|
160
|
+
updateHeight: () => void;
|
|
161
|
+
on: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
162
|
+
off: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback?: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]> | undefined) => SmartWizard;
|
|
163
|
+
once: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
164
|
+
destroy: () => void;
|
|
165
|
+
} | null>["setOptions"]>[0]) => void | undefined;
|
|
166
|
+
getOptions: () => WizardOptions | undefined;
|
|
167
|
+
updateHeight: () => void | undefined;
|
|
168
|
+
loader: {
|
|
169
|
+
show: () => void | undefined;
|
|
170
|
+
hide: () => void | undefined;
|
|
171
|
+
};
|
|
172
|
+
wizard: Ref<{
|
|
173
|
+
readonly main: HTMLElement;
|
|
174
|
+
container: HTMLElement;
|
|
175
|
+
stepItems: {
|
|
176
|
+
step: HTMLElement;
|
|
177
|
+
page: HTMLElement;
|
|
178
|
+
}[];
|
|
179
|
+
readonly id: string;
|
|
180
|
+
extend: (...exts: _smart_wizard_core.WizardExtension[]) => SmartWizard;
|
|
181
|
+
readonly activeIndex: number;
|
|
182
|
+
readonly stepLength: number;
|
|
183
|
+
step: (index: number) => _smart_wizard_core.WizardStep;
|
|
184
|
+
steps: (indexes?: number[]) => _smart_wizard_core.WizardStepCollection;
|
|
185
|
+
readonly activeStep: {
|
|
186
|
+
readonly index: number;
|
|
187
|
+
readonly element: HTMLElement;
|
|
188
|
+
readonly page: HTMLElement;
|
|
189
|
+
hasState: (state: _smart_wizard_core.StepState) => boolean;
|
|
190
|
+
isActive: () => boolean;
|
|
191
|
+
isDisabled: () => boolean;
|
|
192
|
+
isCompleted: () => boolean;
|
|
193
|
+
isHidden: () => boolean;
|
|
194
|
+
state: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
195
|
+
removeState: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
196
|
+
reset: () => _smart_wizard_core.WizardStep;
|
|
197
|
+
disable: () => _smart_wizard_core.WizardStep;
|
|
198
|
+
enable: () => _smart_wizard_core.WizardStep;
|
|
199
|
+
complete: () => _smart_wizard_core.WizardStep;
|
|
200
|
+
warning: () => _smart_wizard_core.WizardStep;
|
|
201
|
+
error: () => _smart_wizard_core.WizardStep;
|
|
202
|
+
show: () => _smart_wizard_core.WizardStep;
|
|
203
|
+
hide: () => _smart_wizard_core.WizardStep;
|
|
204
|
+
};
|
|
205
|
+
readonly progress: number;
|
|
206
|
+
readonly canGoNext: boolean;
|
|
207
|
+
readonly canGoPrev: boolean;
|
|
208
|
+
readonly options: {
|
|
209
|
+
readonly initialStep: number;
|
|
210
|
+
readonly theme: string;
|
|
211
|
+
readonly colorScheme: _smart_wizard_core.ColorScheme;
|
|
212
|
+
readonly layout: _smart_wizard_core.WizardLayout;
|
|
213
|
+
readonly color: _smart_wizard_core.WizardColor;
|
|
214
|
+
readonly behavior: {
|
|
215
|
+
autoHeight: boolean;
|
|
216
|
+
useUrlHash: boolean;
|
|
217
|
+
supportBrowserHistory: boolean;
|
|
218
|
+
};
|
|
219
|
+
readonly navigation: {
|
|
220
|
+
enabled: boolean;
|
|
221
|
+
alwaysClickable: boolean;
|
|
222
|
+
completed: {
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
completeAllPreviousSteps: boolean;
|
|
225
|
+
clearOnBack: boolean;
|
|
226
|
+
clickable: boolean;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
readonly transition: {
|
|
230
|
+
effect: "default" | "none" | "fade" | "slideHorizontal" | "slideVertical" | "slideSwing" | "css" | string;
|
|
231
|
+
speed: number;
|
|
232
|
+
easing: string;
|
|
233
|
+
css: {
|
|
234
|
+
prefix: string;
|
|
235
|
+
forward: {
|
|
236
|
+
show: string;
|
|
237
|
+
hide: string;
|
|
238
|
+
};
|
|
239
|
+
backward: {
|
|
240
|
+
show: string;
|
|
241
|
+
hide: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly keyboardNavigation: {
|
|
246
|
+
enabled: boolean;
|
|
247
|
+
keys: {
|
|
248
|
+
left: string[];
|
|
249
|
+
right: string[];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly stepStates: {
|
|
253
|
+
completed: number[];
|
|
254
|
+
disabled: number[];
|
|
255
|
+
hidden: number[];
|
|
256
|
+
error: number[];
|
|
257
|
+
warning: number[];
|
|
258
|
+
};
|
|
259
|
+
readonly swipeNavigation: {
|
|
260
|
+
enabled: boolean;
|
|
261
|
+
threshold: number;
|
|
262
|
+
};
|
|
263
|
+
readonly scrollToView: boolean;
|
|
264
|
+
readonly contentLoader: _smart_wizard_core.ContentLoader | null;
|
|
265
|
+
};
|
|
266
|
+
readonly width: number;
|
|
267
|
+
readonly height: number;
|
|
268
|
+
readonly info: {
|
|
269
|
+
stepInfo: {
|
|
270
|
+
currentStep: number;
|
|
271
|
+
totalSteps: number;
|
|
272
|
+
};
|
|
273
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
274
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
275
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
276
|
+
width: number;
|
|
277
|
+
height: number;
|
|
278
|
+
};
|
|
279
|
+
next: () => void;
|
|
280
|
+
prev: () => void;
|
|
281
|
+
first: () => void;
|
|
282
|
+
last: () => void;
|
|
283
|
+
goTo: (stepIndex: number, options?: {
|
|
284
|
+
force?: boolean;
|
|
285
|
+
}) => void;
|
|
286
|
+
reset: () => void;
|
|
287
|
+
setOptions: (options: Partial<WizardOptions>) => void;
|
|
288
|
+
getOptions: () => WizardOptions;
|
|
289
|
+
readonly loader: {
|
|
290
|
+
show: () => void;
|
|
291
|
+
hide: () => void;
|
|
292
|
+
};
|
|
293
|
+
updateHeight: () => void;
|
|
294
|
+
on: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
295
|
+
off: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback?: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]> | undefined) => SmartWizard;
|
|
296
|
+
once: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
297
|
+
destroy: () => void;
|
|
298
|
+
} | null, SmartWizard | {
|
|
299
|
+
readonly main: HTMLElement;
|
|
300
|
+
container: HTMLElement;
|
|
301
|
+
stepItems: {
|
|
302
|
+
step: HTMLElement;
|
|
303
|
+
page: HTMLElement;
|
|
304
|
+
}[];
|
|
305
|
+
readonly id: string;
|
|
306
|
+
extend: (...exts: _smart_wizard_core.WizardExtension[]) => SmartWizard;
|
|
307
|
+
readonly activeIndex: number;
|
|
308
|
+
readonly stepLength: number;
|
|
309
|
+
step: (index: number) => _smart_wizard_core.WizardStep;
|
|
310
|
+
steps: (indexes?: number[]) => _smart_wizard_core.WizardStepCollection;
|
|
311
|
+
readonly activeStep: {
|
|
312
|
+
readonly index: number;
|
|
313
|
+
readonly element: HTMLElement;
|
|
314
|
+
readonly page: HTMLElement;
|
|
315
|
+
hasState: (state: _smart_wizard_core.StepState) => boolean;
|
|
316
|
+
isActive: () => boolean;
|
|
317
|
+
isDisabled: () => boolean;
|
|
318
|
+
isCompleted: () => boolean;
|
|
319
|
+
isHidden: () => boolean;
|
|
320
|
+
state: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
321
|
+
removeState: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
322
|
+
reset: () => _smart_wizard_core.WizardStep;
|
|
323
|
+
disable: () => _smart_wizard_core.WizardStep;
|
|
324
|
+
enable: () => _smart_wizard_core.WizardStep;
|
|
325
|
+
complete: () => _smart_wizard_core.WizardStep;
|
|
326
|
+
warning: () => _smart_wizard_core.WizardStep;
|
|
327
|
+
error: () => _smart_wizard_core.WizardStep;
|
|
328
|
+
show: () => _smart_wizard_core.WizardStep;
|
|
329
|
+
hide: () => _smart_wizard_core.WizardStep;
|
|
330
|
+
};
|
|
331
|
+
readonly progress: number;
|
|
332
|
+
readonly canGoNext: boolean;
|
|
333
|
+
readonly canGoPrev: boolean;
|
|
334
|
+
readonly options: {
|
|
335
|
+
readonly initialStep: number;
|
|
336
|
+
readonly theme: string;
|
|
337
|
+
readonly colorScheme: _smart_wizard_core.ColorScheme;
|
|
338
|
+
readonly layout: _smart_wizard_core.WizardLayout;
|
|
339
|
+
readonly color: _smart_wizard_core.WizardColor;
|
|
340
|
+
readonly behavior: {
|
|
341
|
+
autoHeight: boolean;
|
|
342
|
+
useUrlHash: boolean;
|
|
343
|
+
supportBrowserHistory: boolean;
|
|
344
|
+
};
|
|
345
|
+
readonly navigation: {
|
|
346
|
+
enabled: boolean;
|
|
347
|
+
alwaysClickable: boolean;
|
|
348
|
+
completed: {
|
|
349
|
+
enabled: boolean;
|
|
350
|
+
completeAllPreviousSteps: boolean;
|
|
351
|
+
clearOnBack: boolean;
|
|
352
|
+
clickable: boolean;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
readonly transition: {
|
|
356
|
+
effect: "default" | "none" | "fade" | "slideHorizontal" | "slideVertical" | "slideSwing" | "css" | string;
|
|
357
|
+
speed: number;
|
|
358
|
+
easing: string;
|
|
359
|
+
css: {
|
|
360
|
+
prefix: string;
|
|
361
|
+
forward: {
|
|
362
|
+
show: string;
|
|
363
|
+
hide: string;
|
|
364
|
+
};
|
|
365
|
+
backward: {
|
|
366
|
+
show: string;
|
|
367
|
+
hide: string;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
readonly keyboardNavigation: {
|
|
372
|
+
enabled: boolean;
|
|
373
|
+
keys: {
|
|
374
|
+
left: string[];
|
|
375
|
+
right: string[];
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
readonly stepStates: {
|
|
379
|
+
completed: number[];
|
|
380
|
+
disabled: number[];
|
|
381
|
+
hidden: number[];
|
|
382
|
+
error: number[];
|
|
383
|
+
warning: number[];
|
|
384
|
+
};
|
|
385
|
+
readonly swipeNavigation: {
|
|
386
|
+
enabled: boolean;
|
|
387
|
+
threshold: number;
|
|
388
|
+
};
|
|
389
|
+
readonly scrollToView: boolean;
|
|
390
|
+
readonly contentLoader: _smart_wizard_core.ContentLoader | null;
|
|
391
|
+
};
|
|
392
|
+
readonly width: number;
|
|
393
|
+
readonly height: number;
|
|
394
|
+
readonly info: {
|
|
395
|
+
stepInfo: {
|
|
396
|
+
currentStep: number;
|
|
397
|
+
totalSteps: number;
|
|
398
|
+
};
|
|
399
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
400
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
401
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
402
|
+
width: number;
|
|
403
|
+
height: number;
|
|
404
|
+
};
|
|
405
|
+
next: () => void;
|
|
406
|
+
prev: () => void;
|
|
407
|
+
first: () => void;
|
|
408
|
+
last: () => void;
|
|
409
|
+
goTo: (stepIndex: number, options?: {
|
|
410
|
+
force?: boolean;
|
|
411
|
+
}) => void;
|
|
412
|
+
reset: () => void;
|
|
413
|
+
setOptions: (options: Partial<WizardOptions>) => void;
|
|
414
|
+
getOptions: () => WizardOptions;
|
|
415
|
+
readonly loader: {
|
|
416
|
+
show: () => void;
|
|
417
|
+
hide: () => void;
|
|
418
|
+
};
|
|
419
|
+
updateHeight: () => void;
|
|
420
|
+
on: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
421
|
+
off: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback?: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]> | undefined) => SmartWizard;
|
|
422
|
+
once: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
423
|
+
destroy: () => void;
|
|
424
|
+
} | null>;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
export { useSmartWizard };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import * as _smart_wizard_core from '@smart-wizard/core';
|
|
4
|
+
import { WizardOptions, WizardInfo, SmartWizard } from '@smart-wizard/core';
|
|
5
|
+
|
|
6
|
+
declare function useSmartWizard(containerRef: Ref<HTMLElement | null>, options: Partial<WizardOptions>): {
|
|
7
|
+
info: Ref<{
|
|
8
|
+
stepInfo: {
|
|
9
|
+
currentStep: number;
|
|
10
|
+
totalSteps: number;
|
|
11
|
+
};
|
|
12
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
13
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
14
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}, WizardInfo | {
|
|
18
|
+
stepInfo: {
|
|
19
|
+
currentStep: number;
|
|
20
|
+
totalSteps: number;
|
|
21
|
+
};
|
|
22
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
23
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
24
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}>;
|
|
28
|
+
stepInfo: vue.ComputedRef<{
|
|
29
|
+
currentStep: number;
|
|
30
|
+
totalSteps: number;
|
|
31
|
+
}>;
|
|
32
|
+
next: () => void | undefined;
|
|
33
|
+
prev: () => void | undefined;
|
|
34
|
+
first: () => void | undefined;
|
|
35
|
+
last: () => void | undefined;
|
|
36
|
+
goTo: (index: number, force?: boolean) => void | undefined;
|
|
37
|
+
reset: () => void | undefined;
|
|
38
|
+
destroy: () => void | undefined;
|
|
39
|
+
setOptions: (opts: Parameters<NonNullable<{
|
|
40
|
+
readonly main: HTMLElement;
|
|
41
|
+
container: HTMLElement;
|
|
42
|
+
stepItems: {
|
|
43
|
+
step: HTMLElement;
|
|
44
|
+
page: HTMLElement;
|
|
45
|
+
}[];
|
|
46
|
+
readonly id: string;
|
|
47
|
+
extend: (...exts: _smart_wizard_core.WizardExtension[]) => SmartWizard;
|
|
48
|
+
readonly activeIndex: number;
|
|
49
|
+
readonly stepLength: number;
|
|
50
|
+
step: (index: number) => _smart_wizard_core.WizardStep;
|
|
51
|
+
steps: (indexes?: number[]) => _smart_wizard_core.WizardStepCollection;
|
|
52
|
+
readonly activeStep: {
|
|
53
|
+
readonly index: number;
|
|
54
|
+
readonly element: HTMLElement;
|
|
55
|
+
readonly page: HTMLElement;
|
|
56
|
+
hasState: (state: _smart_wizard_core.StepState) => boolean;
|
|
57
|
+
isActive: () => boolean;
|
|
58
|
+
isDisabled: () => boolean;
|
|
59
|
+
isCompleted: () => boolean;
|
|
60
|
+
isHidden: () => boolean;
|
|
61
|
+
state: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
62
|
+
removeState: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
63
|
+
reset: () => _smart_wizard_core.WizardStep;
|
|
64
|
+
disable: () => _smart_wizard_core.WizardStep;
|
|
65
|
+
enable: () => _smart_wizard_core.WizardStep;
|
|
66
|
+
complete: () => _smart_wizard_core.WizardStep;
|
|
67
|
+
warning: () => _smart_wizard_core.WizardStep;
|
|
68
|
+
error: () => _smart_wizard_core.WizardStep;
|
|
69
|
+
show: () => _smart_wizard_core.WizardStep;
|
|
70
|
+
hide: () => _smart_wizard_core.WizardStep;
|
|
71
|
+
};
|
|
72
|
+
readonly progress: number;
|
|
73
|
+
readonly canGoNext: boolean;
|
|
74
|
+
readonly canGoPrev: boolean;
|
|
75
|
+
readonly options: {
|
|
76
|
+
readonly initialStep: number;
|
|
77
|
+
readonly theme: string;
|
|
78
|
+
readonly colorScheme: _smart_wizard_core.ColorScheme;
|
|
79
|
+
readonly layout: _smart_wizard_core.WizardLayout;
|
|
80
|
+
readonly color: _smart_wizard_core.WizardColor;
|
|
81
|
+
readonly behavior: {
|
|
82
|
+
autoHeight: boolean;
|
|
83
|
+
useUrlHash: boolean;
|
|
84
|
+
supportBrowserHistory: boolean;
|
|
85
|
+
};
|
|
86
|
+
readonly navigation: {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
alwaysClickable: boolean;
|
|
89
|
+
completed: {
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
completeAllPreviousSteps: boolean;
|
|
92
|
+
clearOnBack: boolean;
|
|
93
|
+
clickable: boolean;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
readonly transition: {
|
|
97
|
+
effect: "default" | "none" | "fade" | "slideHorizontal" | "slideVertical" | "slideSwing" | "css" | string;
|
|
98
|
+
speed: number;
|
|
99
|
+
easing: string;
|
|
100
|
+
css: {
|
|
101
|
+
prefix: string;
|
|
102
|
+
forward: {
|
|
103
|
+
show: string;
|
|
104
|
+
hide: string;
|
|
105
|
+
};
|
|
106
|
+
backward: {
|
|
107
|
+
show: string;
|
|
108
|
+
hide: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly keyboardNavigation: {
|
|
113
|
+
enabled: boolean;
|
|
114
|
+
keys: {
|
|
115
|
+
left: string[];
|
|
116
|
+
right: string[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
readonly stepStates: {
|
|
120
|
+
completed: number[];
|
|
121
|
+
disabled: number[];
|
|
122
|
+
hidden: number[];
|
|
123
|
+
error: number[];
|
|
124
|
+
warning: number[];
|
|
125
|
+
};
|
|
126
|
+
readonly swipeNavigation: {
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
threshold: number;
|
|
129
|
+
};
|
|
130
|
+
readonly scrollToView: boolean;
|
|
131
|
+
readonly contentLoader: _smart_wizard_core.ContentLoader | null;
|
|
132
|
+
};
|
|
133
|
+
readonly width: number;
|
|
134
|
+
readonly height: number;
|
|
135
|
+
readonly info: {
|
|
136
|
+
stepInfo: {
|
|
137
|
+
currentStep: number;
|
|
138
|
+
totalSteps: number;
|
|
139
|
+
};
|
|
140
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
141
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
142
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
143
|
+
width: number;
|
|
144
|
+
height: number;
|
|
145
|
+
};
|
|
146
|
+
next: () => void;
|
|
147
|
+
prev: () => void;
|
|
148
|
+
first: () => void;
|
|
149
|
+
last: () => void;
|
|
150
|
+
goTo: (stepIndex: number, options?: {
|
|
151
|
+
force?: boolean;
|
|
152
|
+
}) => void;
|
|
153
|
+
reset: () => void;
|
|
154
|
+
setOptions: (options: Partial<WizardOptions>) => void;
|
|
155
|
+
getOptions: () => WizardOptions;
|
|
156
|
+
readonly loader: {
|
|
157
|
+
show: () => void;
|
|
158
|
+
hide: () => void;
|
|
159
|
+
};
|
|
160
|
+
updateHeight: () => void;
|
|
161
|
+
on: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
162
|
+
off: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback?: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]> | undefined) => SmartWizard;
|
|
163
|
+
once: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
164
|
+
destroy: () => void;
|
|
165
|
+
} | null>["setOptions"]>[0]) => void | undefined;
|
|
166
|
+
getOptions: () => WizardOptions | undefined;
|
|
167
|
+
updateHeight: () => void | undefined;
|
|
168
|
+
loader: {
|
|
169
|
+
show: () => void | undefined;
|
|
170
|
+
hide: () => void | undefined;
|
|
171
|
+
};
|
|
172
|
+
wizard: Ref<{
|
|
173
|
+
readonly main: HTMLElement;
|
|
174
|
+
container: HTMLElement;
|
|
175
|
+
stepItems: {
|
|
176
|
+
step: HTMLElement;
|
|
177
|
+
page: HTMLElement;
|
|
178
|
+
}[];
|
|
179
|
+
readonly id: string;
|
|
180
|
+
extend: (...exts: _smart_wizard_core.WizardExtension[]) => SmartWizard;
|
|
181
|
+
readonly activeIndex: number;
|
|
182
|
+
readonly stepLength: number;
|
|
183
|
+
step: (index: number) => _smart_wizard_core.WizardStep;
|
|
184
|
+
steps: (indexes?: number[]) => _smart_wizard_core.WizardStepCollection;
|
|
185
|
+
readonly activeStep: {
|
|
186
|
+
readonly index: number;
|
|
187
|
+
readonly element: HTMLElement;
|
|
188
|
+
readonly page: HTMLElement;
|
|
189
|
+
hasState: (state: _smart_wizard_core.StepState) => boolean;
|
|
190
|
+
isActive: () => boolean;
|
|
191
|
+
isDisabled: () => boolean;
|
|
192
|
+
isCompleted: () => boolean;
|
|
193
|
+
isHidden: () => boolean;
|
|
194
|
+
state: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
195
|
+
removeState: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
196
|
+
reset: () => _smart_wizard_core.WizardStep;
|
|
197
|
+
disable: () => _smart_wizard_core.WizardStep;
|
|
198
|
+
enable: () => _smart_wizard_core.WizardStep;
|
|
199
|
+
complete: () => _smart_wizard_core.WizardStep;
|
|
200
|
+
warning: () => _smart_wizard_core.WizardStep;
|
|
201
|
+
error: () => _smart_wizard_core.WizardStep;
|
|
202
|
+
show: () => _smart_wizard_core.WizardStep;
|
|
203
|
+
hide: () => _smart_wizard_core.WizardStep;
|
|
204
|
+
};
|
|
205
|
+
readonly progress: number;
|
|
206
|
+
readonly canGoNext: boolean;
|
|
207
|
+
readonly canGoPrev: boolean;
|
|
208
|
+
readonly options: {
|
|
209
|
+
readonly initialStep: number;
|
|
210
|
+
readonly theme: string;
|
|
211
|
+
readonly colorScheme: _smart_wizard_core.ColorScheme;
|
|
212
|
+
readonly layout: _smart_wizard_core.WizardLayout;
|
|
213
|
+
readonly color: _smart_wizard_core.WizardColor;
|
|
214
|
+
readonly behavior: {
|
|
215
|
+
autoHeight: boolean;
|
|
216
|
+
useUrlHash: boolean;
|
|
217
|
+
supportBrowserHistory: boolean;
|
|
218
|
+
};
|
|
219
|
+
readonly navigation: {
|
|
220
|
+
enabled: boolean;
|
|
221
|
+
alwaysClickable: boolean;
|
|
222
|
+
completed: {
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
completeAllPreviousSteps: boolean;
|
|
225
|
+
clearOnBack: boolean;
|
|
226
|
+
clickable: boolean;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
readonly transition: {
|
|
230
|
+
effect: "default" | "none" | "fade" | "slideHorizontal" | "slideVertical" | "slideSwing" | "css" | string;
|
|
231
|
+
speed: number;
|
|
232
|
+
easing: string;
|
|
233
|
+
css: {
|
|
234
|
+
prefix: string;
|
|
235
|
+
forward: {
|
|
236
|
+
show: string;
|
|
237
|
+
hide: string;
|
|
238
|
+
};
|
|
239
|
+
backward: {
|
|
240
|
+
show: string;
|
|
241
|
+
hide: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly keyboardNavigation: {
|
|
246
|
+
enabled: boolean;
|
|
247
|
+
keys: {
|
|
248
|
+
left: string[];
|
|
249
|
+
right: string[];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly stepStates: {
|
|
253
|
+
completed: number[];
|
|
254
|
+
disabled: number[];
|
|
255
|
+
hidden: number[];
|
|
256
|
+
error: number[];
|
|
257
|
+
warning: number[];
|
|
258
|
+
};
|
|
259
|
+
readonly swipeNavigation: {
|
|
260
|
+
enabled: boolean;
|
|
261
|
+
threshold: number;
|
|
262
|
+
};
|
|
263
|
+
readonly scrollToView: boolean;
|
|
264
|
+
readonly contentLoader: _smart_wizard_core.ContentLoader | null;
|
|
265
|
+
};
|
|
266
|
+
readonly width: number;
|
|
267
|
+
readonly height: number;
|
|
268
|
+
readonly info: {
|
|
269
|
+
stepInfo: {
|
|
270
|
+
currentStep: number;
|
|
271
|
+
totalSteps: number;
|
|
272
|
+
};
|
|
273
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
274
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
275
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
276
|
+
width: number;
|
|
277
|
+
height: number;
|
|
278
|
+
};
|
|
279
|
+
next: () => void;
|
|
280
|
+
prev: () => void;
|
|
281
|
+
first: () => void;
|
|
282
|
+
last: () => void;
|
|
283
|
+
goTo: (stepIndex: number, options?: {
|
|
284
|
+
force?: boolean;
|
|
285
|
+
}) => void;
|
|
286
|
+
reset: () => void;
|
|
287
|
+
setOptions: (options: Partial<WizardOptions>) => void;
|
|
288
|
+
getOptions: () => WizardOptions;
|
|
289
|
+
readonly loader: {
|
|
290
|
+
show: () => void;
|
|
291
|
+
hide: () => void;
|
|
292
|
+
};
|
|
293
|
+
updateHeight: () => void;
|
|
294
|
+
on: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
295
|
+
off: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback?: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]> | undefined) => SmartWizard;
|
|
296
|
+
once: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
297
|
+
destroy: () => void;
|
|
298
|
+
} | null, SmartWizard | {
|
|
299
|
+
readonly main: HTMLElement;
|
|
300
|
+
container: HTMLElement;
|
|
301
|
+
stepItems: {
|
|
302
|
+
step: HTMLElement;
|
|
303
|
+
page: HTMLElement;
|
|
304
|
+
}[];
|
|
305
|
+
readonly id: string;
|
|
306
|
+
extend: (...exts: _smart_wizard_core.WizardExtension[]) => SmartWizard;
|
|
307
|
+
readonly activeIndex: number;
|
|
308
|
+
readonly stepLength: number;
|
|
309
|
+
step: (index: number) => _smart_wizard_core.WizardStep;
|
|
310
|
+
steps: (indexes?: number[]) => _smart_wizard_core.WizardStepCollection;
|
|
311
|
+
readonly activeStep: {
|
|
312
|
+
readonly index: number;
|
|
313
|
+
readonly element: HTMLElement;
|
|
314
|
+
readonly page: HTMLElement;
|
|
315
|
+
hasState: (state: _smart_wizard_core.StepState) => boolean;
|
|
316
|
+
isActive: () => boolean;
|
|
317
|
+
isDisabled: () => boolean;
|
|
318
|
+
isCompleted: () => boolean;
|
|
319
|
+
isHidden: () => boolean;
|
|
320
|
+
state: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
321
|
+
removeState: (s: _smart_wizard_core.StepState) => _smart_wizard_core.WizardStep;
|
|
322
|
+
reset: () => _smart_wizard_core.WizardStep;
|
|
323
|
+
disable: () => _smart_wizard_core.WizardStep;
|
|
324
|
+
enable: () => _smart_wizard_core.WizardStep;
|
|
325
|
+
complete: () => _smart_wizard_core.WizardStep;
|
|
326
|
+
warning: () => _smart_wizard_core.WizardStep;
|
|
327
|
+
error: () => _smart_wizard_core.WizardStep;
|
|
328
|
+
show: () => _smart_wizard_core.WizardStep;
|
|
329
|
+
hide: () => _smart_wizard_core.WizardStep;
|
|
330
|
+
};
|
|
331
|
+
readonly progress: number;
|
|
332
|
+
readonly canGoNext: boolean;
|
|
333
|
+
readonly canGoPrev: boolean;
|
|
334
|
+
readonly options: {
|
|
335
|
+
readonly initialStep: number;
|
|
336
|
+
readonly theme: string;
|
|
337
|
+
readonly colorScheme: _smart_wizard_core.ColorScheme;
|
|
338
|
+
readonly layout: _smart_wizard_core.WizardLayout;
|
|
339
|
+
readonly color: _smart_wizard_core.WizardColor;
|
|
340
|
+
readonly behavior: {
|
|
341
|
+
autoHeight: boolean;
|
|
342
|
+
useUrlHash: boolean;
|
|
343
|
+
supportBrowserHistory: boolean;
|
|
344
|
+
};
|
|
345
|
+
readonly navigation: {
|
|
346
|
+
enabled: boolean;
|
|
347
|
+
alwaysClickable: boolean;
|
|
348
|
+
completed: {
|
|
349
|
+
enabled: boolean;
|
|
350
|
+
completeAllPreviousSteps: boolean;
|
|
351
|
+
clearOnBack: boolean;
|
|
352
|
+
clickable: boolean;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
readonly transition: {
|
|
356
|
+
effect: "default" | "none" | "fade" | "slideHorizontal" | "slideVertical" | "slideSwing" | "css" | string;
|
|
357
|
+
speed: number;
|
|
358
|
+
easing: string;
|
|
359
|
+
css: {
|
|
360
|
+
prefix: string;
|
|
361
|
+
forward: {
|
|
362
|
+
show: string;
|
|
363
|
+
hide: string;
|
|
364
|
+
};
|
|
365
|
+
backward: {
|
|
366
|
+
show: string;
|
|
367
|
+
hide: string;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
readonly keyboardNavigation: {
|
|
372
|
+
enabled: boolean;
|
|
373
|
+
keys: {
|
|
374
|
+
left: string[];
|
|
375
|
+
right: string[];
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
readonly stepStates: {
|
|
379
|
+
completed: number[];
|
|
380
|
+
disabled: number[];
|
|
381
|
+
hidden: number[];
|
|
382
|
+
error: number[];
|
|
383
|
+
warning: number[];
|
|
384
|
+
};
|
|
385
|
+
readonly swipeNavigation: {
|
|
386
|
+
enabled: boolean;
|
|
387
|
+
threshold: number;
|
|
388
|
+
};
|
|
389
|
+
readonly scrollToView: boolean;
|
|
390
|
+
readonly contentLoader: _smart_wizard_core.ContentLoader | null;
|
|
391
|
+
};
|
|
392
|
+
readonly width: number;
|
|
393
|
+
readonly height: number;
|
|
394
|
+
readonly info: {
|
|
395
|
+
stepInfo: {
|
|
396
|
+
currentStep: number;
|
|
397
|
+
totalSteps: number;
|
|
398
|
+
};
|
|
399
|
+
contentDirection: _smart_wizard_core.ContentDirection;
|
|
400
|
+
layout: _smart_wizard_core.WizardLayout;
|
|
401
|
+
colorScheme: _smart_wizard_core.ColorScheme;
|
|
402
|
+
width: number;
|
|
403
|
+
height: number;
|
|
404
|
+
};
|
|
405
|
+
next: () => void;
|
|
406
|
+
prev: () => void;
|
|
407
|
+
first: () => void;
|
|
408
|
+
last: () => void;
|
|
409
|
+
goTo: (stepIndex: number, options?: {
|
|
410
|
+
force?: boolean;
|
|
411
|
+
}) => void;
|
|
412
|
+
reset: () => void;
|
|
413
|
+
setOptions: (options: Partial<WizardOptions>) => void;
|
|
414
|
+
getOptions: () => WizardOptions;
|
|
415
|
+
readonly loader: {
|
|
416
|
+
show: () => void;
|
|
417
|
+
hide: () => void;
|
|
418
|
+
};
|
|
419
|
+
updateHeight: () => void;
|
|
420
|
+
on: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
421
|
+
off: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback?: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]> | undefined) => SmartWizard;
|
|
422
|
+
once: <K extends keyof _smart_wizard_core.WizardEvents>(eventName: K, callback: _smart_wizard_core.EventCallback<_smart_wizard_core.WizardEvents[K]>) => SmartWizard;
|
|
423
|
+
destroy: () => void;
|
|
424
|
+
} | null>;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
export { useSmartWizard };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
useSmartWizard: () => useSmartWizard
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/useSmartWizard.ts
|
|
28
|
+
var import_vue = require("vue");
|
|
29
|
+
var import_core = require("@smart-wizard/core");
|
|
30
|
+
function useSmartWizard(containerRef, options) {
|
|
31
|
+
const wizard = (0, import_vue.ref)(null);
|
|
32
|
+
const info = (0, import_vue.ref)({
|
|
33
|
+
stepInfo: { currentStep: 0, totalSteps: 0 },
|
|
34
|
+
contentDirection: "ltr",
|
|
35
|
+
layout: "horizontal",
|
|
36
|
+
colorScheme: "none",
|
|
37
|
+
width: 0,
|
|
38
|
+
height: 0
|
|
39
|
+
});
|
|
40
|
+
const stepInfo = (0, import_vue.computed)(() => info.value.stepInfo);
|
|
41
|
+
const handleStepChange = () => {
|
|
42
|
+
if (wizard.value) {
|
|
43
|
+
info.value = wizard.value.info;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
(0, import_vue.onMounted)(() => {
|
|
47
|
+
if (!containerRef.value) return;
|
|
48
|
+
wizard.value = new import_core.SmartWizard(containerRef.value, options);
|
|
49
|
+
wizard.value.on("showStep", handleStepChange);
|
|
50
|
+
wizard.value.on("initialized", handleStepChange);
|
|
51
|
+
handleStepChange();
|
|
52
|
+
});
|
|
53
|
+
(0, import_vue.onUnmounted)(() => {
|
|
54
|
+
if (wizard.value) {
|
|
55
|
+
wizard.value.off("showStep", handleStepChange);
|
|
56
|
+
wizard.value.off("initialized", handleStepChange);
|
|
57
|
+
wizard.value.destroy();
|
|
58
|
+
wizard.value = null;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
info,
|
|
63
|
+
stepInfo,
|
|
64
|
+
next: () => wizard.value?.next(),
|
|
65
|
+
prev: () => wizard.value?.prev(),
|
|
66
|
+
first: () => wizard.value?.first(),
|
|
67
|
+
last: () => wizard.value?.last(),
|
|
68
|
+
goTo: (index, force) => wizard.value?.goTo(index, { force }),
|
|
69
|
+
reset: () => wizard.value?.reset(),
|
|
70
|
+
destroy: () => wizard.value?.destroy(),
|
|
71
|
+
setOptions: (opts) => wizard.value?.setOptions(opts),
|
|
72
|
+
getOptions: () => wizard.value?.getOptions(),
|
|
73
|
+
updateHeight: () => wizard.value?.updateHeight(),
|
|
74
|
+
loader: {
|
|
75
|
+
show: () => wizard.value?.loader.show(),
|
|
76
|
+
hide: () => wizard.value?.loader.hide()
|
|
77
|
+
},
|
|
78
|
+
wizard
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
useSmartWizard
|
|
84
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/useSmartWizard.ts
|
|
2
|
+
import { ref, computed, onMounted, onUnmounted } from "vue";
|
|
3
|
+
import { SmartWizard } from "@smart-wizard/core";
|
|
4
|
+
function useSmartWizard(containerRef, options) {
|
|
5
|
+
const wizard = ref(null);
|
|
6
|
+
const info = ref({
|
|
7
|
+
stepInfo: { currentStep: 0, totalSteps: 0 },
|
|
8
|
+
contentDirection: "ltr",
|
|
9
|
+
layout: "horizontal",
|
|
10
|
+
colorScheme: "none",
|
|
11
|
+
width: 0,
|
|
12
|
+
height: 0
|
|
13
|
+
});
|
|
14
|
+
const stepInfo = computed(() => info.value.stepInfo);
|
|
15
|
+
const handleStepChange = () => {
|
|
16
|
+
if (wizard.value) {
|
|
17
|
+
info.value = wizard.value.info;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
if (!containerRef.value) return;
|
|
22
|
+
wizard.value = new SmartWizard(containerRef.value, options);
|
|
23
|
+
wizard.value.on("showStep", handleStepChange);
|
|
24
|
+
wizard.value.on("initialized", handleStepChange);
|
|
25
|
+
handleStepChange();
|
|
26
|
+
});
|
|
27
|
+
onUnmounted(() => {
|
|
28
|
+
if (wizard.value) {
|
|
29
|
+
wizard.value.off("showStep", handleStepChange);
|
|
30
|
+
wizard.value.off("initialized", handleStepChange);
|
|
31
|
+
wizard.value.destroy();
|
|
32
|
+
wizard.value = null;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
info,
|
|
37
|
+
stepInfo,
|
|
38
|
+
next: () => wizard.value?.next(),
|
|
39
|
+
prev: () => wizard.value?.prev(),
|
|
40
|
+
first: () => wizard.value?.first(),
|
|
41
|
+
last: () => wizard.value?.last(),
|
|
42
|
+
goTo: (index, force) => wizard.value?.goTo(index, { force }),
|
|
43
|
+
reset: () => wizard.value?.reset(),
|
|
44
|
+
destroy: () => wizard.value?.destroy(),
|
|
45
|
+
setOptions: (opts) => wizard.value?.setOptions(opts),
|
|
46
|
+
getOptions: () => wizard.value?.getOptions(),
|
|
47
|
+
updateHeight: () => wizard.value?.updateHeight(),
|
|
48
|
+
loader: {
|
|
49
|
+
show: () => wizard.value?.loader.show(),
|
|
50
|
+
hide: () => wizard.value?.loader.hide()
|
|
51
|
+
},
|
|
52
|
+
wizard
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
useSmartWizard
|
|
57
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-wizard/vue",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Vue bindings for SmartWizard - modern, framework-agnostic wizard/stepper component",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@smart-wizard/core": "1.0.1"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"vue": "^3.0.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"vue": "^3.0.0",
|
|
16
|
+
"tsup": "^8.0.0",
|
|
17
|
+
"typescript": "^5.0.0"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/techlab/smart-wizard.git",
|
|
22
|
+
"directory": "packages/adapters/vue"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/techlab/smart-wizard#readme",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/techlab/smart-wizard/issues"
|
|
27
|
+
},
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "Dipu Rajendran",
|
|
30
|
+
"email": "hello.techlab@gmail.com",
|
|
31
|
+
"url": "https://github.com/techlab"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"import": "./dist/index.mjs",
|
|
45
|
+
"require": "./dist/index.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"wizard",
|
|
50
|
+
"stepper",
|
|
51
|
+
"form",
|
|
52
|
+
"multi-step",
|
|
53
|
+
"vue",
|
|
54
|
+
"smartwizard"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --external @smart-wizard/core --external vue",
|
|
58
|
+
"dev": "tsup src/index.ts --format cjs,esm --watch"
|
|
59
|
+
}
|
|
6
60
|
}
|