Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/wizard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ The wizard component can be used to display a stepped workflow.
| `back-button-title` | String | Text that is displayed within the button |
| `back-button-tooltip` | String | Text that is displayed within the button tooltip |
| `display-back-button` | Boolean | Display the Back button |
| `disable-back-button` | Boolean | Disable the Back button |
| `primary-button` | String | Button to make primary: `next`, `back`, or `restart`. Defaults to `next` |
| `restart-button-title` | String | Text that is displayed within the button |
| `restart-button-tooltip` | String | Text that is displayed within the button tooltip |
| `hide-restart-button` | Boolean | Hide the Restart button |
| `disable-restart-button` | Boolean | Disable the Restart button |
| `next-button-title` | String | Text that is displayed within the button |
| `next-button-tooltip` | String | Text that is displayed within the button tooltip |
| `disable-next-button` | Boolean | Disable the Next button |
| `hide-next-button` | Boolean | Hide the Next button |
| `disable-next-button` | Boolean | Disable the Next button |

### Events:
- `stepper-next`: dispatched when the Next button is clicked
Expand Down
12 changes: 12 additions & 0 deletions src/components/wizard/wizard-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
type: Boolean,
attribute: 'disable-next-button'
},
disableBackButton: {
type: Boolean,
attribute: 'disable-back-button'
},
disableRestartButton: {
type: Boolean,
attribute: 'disable-restart-button'
},
nextButtonAriaLabel: {
type: String,
attribute: 'next-button-aria-label'
Expand Down Expand Up @@ -106,6 +114,8 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
this.primaryButton = PRIMARY_BUTTON.NEXT;
this.hideNextButton = false;
this.disableNextButton = false;
this.disableBackButton = false;
this.disableRestartButton = false;
this.nextButtonAriaLabel = '';
this.restartButtonAriaLabel = '';
this.ariaTitle = '';
Expand Down Expand Up @@ -166,6 +176,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
return html`
<d2l-button
@click="${this.#handleBackClick}"
?disabled="${this.disableBackButton}"
?primary="${this.primaryButton === PRIMARY_BUTTON.BACK}"
title="${!this.backButtonTooltip ? this.localize('components:wizard:back.button.tooltip') : this.backButtonTooltip}">
${!this.backButtonTitle ? this.localize('components:wizard:stepper.defaults.back') : this.backButtonTitle}
Expand All @@ -190,6 +201,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
<d2l-button
aria-label="${this.restartButtonAriaLabel}"
@click="${this.#handleRestartClick}"
?disabled="${this.disableRestartButton}"
?primary="${this.primaryButton === PRIMARY_BUTTON.RESTART}"
title="${!this.restartButtonTooltip ? this.localize('components:wizard:restart.button.tooltip') : this.restartButtonTooltip}">
${!this.restartButtonTitle ? this.localize('components:wizard:stepper.defaults.restart') : this.restartButtonTitle}
Expand Down
Loading