Class: Zangdar

Zangdar

new Zangdar (selector, options)

Name Type Description
selector HTMLFormElement | String
options Object
Properties:
Name Type Description
#steps Array.<WizardStep>

Members

$form HTMLFormElement | null private

$prevButtons HTMLElement | null private

currentIndex

Returns current step index

currentIndex number private

params Object private

steps

Returns all wizard steps

steps Array.<WizardStep> private

uniqueId

Returns form unique ID

uuid string private

Methods

count ()number

Returns:
Type Description
number

createFromTemplate (template)Zangdar

Create a wizard from an existing form with a template which is describes it, according to the options passed on wizard instance creation.

Useful to convert programmatically a HTML form into a powerful Zangdar wizard (by keeping only choosen fields).

Name Type Description
template Object

the wizard template

Returns:
Type Description
Zangdar

destroy ()

Destroys wizard instance

TODO
  • destroy wizard

first ()Zangdar

Reveals first step

Returns:
Type Description
Zangdar

getBreadcrumb ()Object

Returns:
Type Description
Object

getCurrentStep ()WizardStep | null

Get the current step

Returns:
Type Description
WizardStep | null the current WizardStep instance if exists, null otherwise

getFormElement ()HTMLFormElement

Get wizard HTML form element

Returns:
Type Description
HTMLFormElement

getStep (key)WizardStep | null

Get a WizardStep instance via his index or his label property (data-label attribute).

Name Type Description
key String | Number

step index or label

Returns:
Type Description
WizardStep | null WizardStep instance if exists, null otherwise

last ()Zangdar

Reveals last step

Returns:
Type Description
Zangdar

next ()Zangdar

Reveals next step

Returns:
Type Description
Zangdar

onNextStep (e) private

Name Type Description
e Event

onPrevStep (e) private

Name Type Description
e Event

onSubmit (e) private

Name Type Description
e Event

prev ()Zangdar

Reveals previous step

Returns:
Type Description
Zangdar

refresh ()Zangdar

Refresh wizard instance

Returns:
Type Description
Zangdar

removeStep (key)Number | Boolean

Remove a step based on his index, label property (data-label attribute) or WizardStep instance

Name Type Description
key WizardStep | String | Number
Returns:
Type Description
Number | Boolean returns the index of removed step if exists, false otherwize

revealStep (value)Zangdar

Reveal a single step based on his index, label property (data-label attribute) or WizardStep instance

Name Type Description
value String | Number | WizardStep
Returns:
Type Description
Zangdar

setOption (key, value)Zangdar

Name Type Description
key String
value *
Returns:
Type Description
Zangdar