1.8.1 • Published 10 months ago

@finastra/wizard v1.8.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Wizard

A wizard is a setup process where the user is guided through a series of steps to achieve a goal. The purpose of the pattern is to simplify tasks by cutting them into smaller ones.It is easy to navigate between the steps which helps the user to complete lengthy forms in less time. Also the user can save it and revisit the wizard when he/she has the relevant required information available.

See it on NPM! How big is this package in your project? Storybook

Usage

Import

npm i @finastra/wizard @finastra/button @finastra/textfield
import '@finastra/wizard';
import '@finastra/textfield';
import '@finastra/button';
...
<fds-wizard id="wizard">
  <fds-text-button slot='left-action' label="Cancel" secondary>
  </fds-text-button>
  <fds-outlined-button slot='next' label="Next" secondary>
  </fds-outlined-button>
  <fds-text-button slot='previous' label="Back" secondary icon="chevron_left">
  </fds-text-button>
  <fds-button slot='done' label="Save" secondary>
  </fds-button>
  <fds-wizard-page slot="page" title="Welcome" description="Welcome page" header>
    <div class="page-content">
      <div class="textfields">
        <fds-textfield label="Last name" icontrailing="" helper="helper text"></fds-textfield>
        <fds-textfield label="Last name" icontrailing="" helper="helper text"></fds-textfield>
        <fds-textfield label="Last name" icontrailing="" helper="helper text"></fds-textfield>
      </div>
      <div class="image">
        <img src="https://i.imgur.com/otY5WR9.png" />
      </div>
    </div>
  </fds-wizard-page>

  <fds-wizard-page slot="page" title="Preferences" description="Preferences page" disabled header>
    <p>put your content here</p>
  </fds-wizard-page>

  <fds-wizard-page slot="page" title="Confirmation" description="Confirmation page" header>
    <p>put your content here</p>
  </fds-wizard-page>
</fds-wizard>

API

Properties

PropertyAttributeTypeDefault
completedcompletedbooleanfalse
currentcurrentbooleanfalse
descriptiondescriptionstring""
disableddisabledbooleanfalse
headerheaderbooleanfalse
iconiconstring""
stepsCounterstepsCounterstring""
titletitlestring""

Methods

MethodType
renderIcon(): TemplateResult<1>
renderStepsCounter(): TemplateResult<1>

fds-wizard

Properties

PropertyAttributeTypeDefaultDescription
currentStepIndexcurrentStepIndexnumber0Index of current active step.
linearlinearbooleanfalseUsed to create a linear stepper that requires the user to complete previous steps before proceeding to following steps. Note that a wizard page is considered as completed when its property completed is true.
stepperOnDarkstepperOnDarkbooleanfalseStepper on dark
stepperPositionstepperPosition"left"\|"right""left"Stepper position
stepsCounterstepsCounterbooleanfalsemake the step counter visible in the stepper.

Methods

MethodType
CheckIfAllBackStepsDisabled(current: number): boolean
CheckIfAllNextStepsDisabled(current: number): boolean
UpdatePage(): void
checkAttributes(page: HTMLElement, index: number): void
checkNextStep(): void
checkNextStepDisabled(pages: HTMLElement[], current: number): void
checkPreviousStepDisabled(pages: HTMLElement[], current: number): void
currentPageIsDisabled(current: number): boolean
currentPageIsFirst(current: number): boolean
currentPageIsLast(current: number): boolean
goToNextStep(pages: HTMLElement[]): void
goToPreviousStep(pages: HTMLElement[]): void
goToStepIndex(index: number): void
onPagesSlotChanged(): void
onStepClickEvent(event: any): void
renderActions(): TemplateResult<ResultType>
renderBackSlot(): TemplateResult<ResultType>
renderCounterInStepper(): TemplateResult<ResultType>
renderNextSlot(): TemplateResult<ResultType>
renderSaveSlot(): TemplateResult<ResultType>
renderStepper(): TemplateResult<ResultType>
updateActionsState(current: number): void
updateCurrentPage(index: number): void
updateStepsCounter(current: number): string

Slots

NameDescription
left-actionSlot to place an element in the left side of the wizard actions bar.
nextSlot to place an element that manages the transition to the next step.
pageDefines a new page inside the wizard that generates a new step automatically.It is Used with the fds-wizard-page web component that could contain: - title: to define a title to the step- icon: to define a link to your hosted icon to be displayed next to the title- description: to define a description to your step- disabled : to disable the step- header: to enable the header display (default is false)- current: to set the step to current- completed: used when linear mode is on to indicate that the step is valid and the next one is unlocked.
previousSlot to place an element that manages the transition to the previous step.
saveSlot to place an element that appears in the last step. The developer could add his own logic in the onClick Event.

CSS Custom Properties

PropertyTypeDefaultDescription
--fds-header-bgcolor"#f3f1fc"Header background color
--fds-icon-bgcolor"#fafafa"Header icon background color
--fds-icon-border-colorcolor"#f3f1fc"Header icon border color
--fds-stepper-bgcolor"#fafafa"Stepper background color
--fds-title-colorcolor"#694ed5"Header title color
1.8.1

10 months ago

1.8.0

12 months ago

1.7.0

1 year ago

1.6.0

1 year ago

1.4.2

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.1.3

2 years ago

1.0.4

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.2.9

1 year ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.10

1 year ago

1.2.11

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.42

2 years ago

0.0.44

2 years ago

1.0.3

2 years ago

0.0.41

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago