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 number private

_params Object private

_steps Array.<WizardStep> private

_uuid string private

currentIndex

Returns current step index

steps

Returns all wizard steps

uniqueId

Returns form unique ID

Methods

_bindEventsContext () private

_buildForm () private

_buildPrevButton () private

_buildSection (label)Element private

Name Type Description
label String
Returns:
Type Description
Element

_buildStep (item, index, last) private

Name Type Description
item HTMLElement
index Number
last Boolean

_buildSteps () private

_firstStep () private

_hidePrevBtns () private

_init () private

_lastStep () private

_nextStep () private

_onStepChange (oldStep, direction) private

Name Type Description
oldStep WizardStep
direction Number

_prevStep () private

_revealStep () private

_validateCurrentStep () private

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