@brightspace-ui/labs 2.59.2 → 2.60.0
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/package.json
CHANGED
|
@@ -61,6 +61,7 @@ The wizard component can be used to display a stepped workflow.
|
|
|
61
61
|
| `back-button-title` | String | Text that is displayed within the button |
|
|
62
62
|
| `back-button-tooltip` | String | Text that is displayed within the button tooltip |
|
|
63
63
|
| `display-back-button` | Boolean | Display the Back button |
|
|
64
|
+
| `primary-button` | String | Button to make primary: `next`, `back`, or `restart`. Defaults to `next` |
|
|
64
65
|
| `restart-button-title` | String | Text that is displayed within the button |
|
|
65
66
|
| `restart-button-tooltip` | String | Text that is displayed within the button tooltip |
|
|
66
67
|
| `hide-restart-button` | Boolean | Hide the Restart button |
|
|
@@ -3,6 +3,12 @@ import { css, html, LitElement, nothing } from 'lit';
|
|
|
3
3
|
import { LocalizeLabsElement } from '../localize-labs-element.js';
|
|
4
4
|
import { offscreenStyles } from '@brightspace-ui/core/components/offscreen/offscreen.js';
|
|
5
5
|
|
|
6
|
+
const PRIMARY_BUTTON = Object.freeze({
|
|
7
|
+
NEXT: 'next',
|
|
8
|
+
BACK: 'back',
|
|
9
|
+
RESTART: 'restart'
|
|
10
|
+
});
|
|
11
|
+
|
|
6
12
|
class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
7
13
|
|
|
8
14
|
static properties = {
|
|
@@ -34,6 +40,10 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
34
40
|
type: Boolean,
|
|
35
41
|
attribute: 'display-back-button'
|
|
36
42
|
},
|
|
43
|
+
primaryButton: {
|
|
44
|
+
type: String,
|
|
45
|
+
attribute: 'primary-button'
|
|
46
|
+
},
|
|
37
47
|
hideRestartButton: {
|
|
38
48
|
type: Boolean,
|
|
39
49
|
attribute: 'hide-restart-button'
|
|
@@ -93,6 +103,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
93
103
|
super();
|
|
94
104
|
this.displayBackButton = false;
|
|
95
105
|
this.hideRestartButton = false;
|
|
106
|
+
this.primaryButton = PRIMARY_BUTTON.NEXT;
|
|
96
107
|
this.hideNextButton = false;
|
|
97
108
|
this.disableNextButton = false;
|
|
98
109
|
this.nextButtonAriaLabel = '';
|
|
@@ -155,6 +166,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
155
166
|
return html`
|
|
156
167
|
<d2l-button
|
|
157
168
|
@click="${this.#handleBackClick}"
|
|
169
|
+
?primary="${this.primaryButton === PRIMARY_BUTTON.BACK}"
|
|
158
170
|
title="${!this.backButtonTooltip ? this.localize('components:wizard:back.button.tooltip') : this.backButtonTooltip}">
|
|
159
171
|
${!this.backButtonTitle ? this.localize('components:wizard:stepper.defaults.back') : this.backButtonTitle}
|
|
160
172
|
</d2l-button>`;
|
|
@@ -167,7 +179,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
167
179
|
class="d2l-labs-wizard-step-button-next"
|
|
168
180
|
@click="${this.#handleNextClick}"
|
|
169
181
|
?disabled="${this.disableNextButton}"
|
|
170
|
-
primary
|
|
182
|
+
?primary="${this.primaryButton === PRIMARY_BUTTON.NEXT}"
|
|
171
183
|
title="${!this.nextButtonTooltip ? this.localize('components:wizard:next.button.tooltip') : this.nextButtonTooltip}">
|
|
172
184
|
${!this.nextButtonTitle ? this.localize('components:wizard:stepper.defaults.next') : this.nextButtonTitle}
|
|
173
185
|
</d2l-button>`;
|
|
@@ -178,6 +190,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
178
190
|
<d2l-button
|
|
179
191
|
aria-label="${this.restartButtonAriaLabel}"
|
|
180
192
|
@click="${this.#handleRestartClick}"
|
|
193
|
+
?primary="${this.primaryButton === PRIMARY_BUTTON.RESTART}"
|
|
181
194
|
title="${!this.restartButtonTooltip ? this.localize('components:wizard:restart.button.tooltip') : this.restartButtonTooltip}">
|
|
182
195
|
${!this.restartButtonTitle ? this.localize('components:wizard:stepper.defaults.restart') : this.restartButtonTitle}
|
|
183
196
|
</d2l-button>`;
|