@brightspace-ui/labs 2.59.2 → 2.60.1
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,13 +61,16 @@ 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
|
+
| `disable-back-button` | Boolean | Disable the Back button |
|
|
65
|
+
| `primary-button` | String | Button to make primary: `next`, `back`, or `restart`. Defaults to `next` |
|
|
64
66
|
| `restart-button-title` | String | Text that is displayed within the button |
|
|
65
67
|
| `restart-button-tooltip` | String | Text that is displayed within the button tooltip |
|
|
66
68
|
| `hide-restart-button` | Boolean | Hide the Restart button |
|
|
69
|
+
| `disable-restart-button` | Boolean | Disable the Restart button |
|
|
67
70
|
| `next-button-title` | String | Text that is displayed within the button |
|
|
68
71
|
| `next-button-tooltip` | String | Text that is displayed within the button tooltip |
|
|
69
|
-
| `disable-next-button` | Boolean | Disable the Next button |
|
|
70
72
|
| `hide-next-button` | Boolean | Hide the Next button |
|
|
73
|
+
| `disable-next-button` | Boolean | Disable the Next button |
|
|
71
74
|
|
|
72
75
|
### Events:
|
|
73
76
|
- `stepper-next`: dispatched when the Next button is clicked
|
|
@@ -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'
|
|
@@ -46,6 +56,14 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
46
56
|
type: Boolean,
|
|
47
57
|
attribute: 'disable-next-button'
|
|
48
58
|
},
|
|
59
|
+
disableBackButton: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
attribute: 'disable-back-button'
|
|
62
|
+
},
|
|
63
|
+
disableRestartButton: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
attribute: 'disable-restart-button'
|
|
66
|
+
},
|
|
49
67
|
nextButtonAriaLabel: {
|
|
50
68
|
type: String,
|
|
51
69
|
attribute: 'next-button-aria-label'
|
|
@@ -93,8 +111,11 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
93
111
|
super();
|
|
94
112
|
this.displayBackButton = false;
|
|
95
113
|
this.hideRestartButton = false;
|
|
114
|
+
this.primaryButton = PRIMARY_BUTTON.NEXT;
|
|
96
115
|
this.hideNextButton = false;
|
|
97
116
|
this.disableNextButton = false;
|
|
117
|
+
this.disableBackButton = false;
|
|
118
|
+
this.disableRestartButton = false;
|
|
98
119
|
this.nextButtonAriaLabel = '';
|
|
99
120
|
this.restartButtonAriaLabel = '';
|
|
100
121
|
this.ariaTitle = '';
|
|
@@ -155,6 +176,8 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
155
176
|
return html`
|
|
156
177
|
<d2l-button
|
|
157
178
|
@click="${this.#handleBackClick}"
|
|
179
|
+
?disabled="${this.disableBackButton}"
|
|
180
|
+
?primary="${this.primaryButton === PRIMARY_BUTTON.BACK}"
|
|
158
181
|
title="${!this.backButtonTooltip ? this.localize('components:wizard:back.button.tooltip') : this.backButtonTooltip}">
|
|
159
182
|
${!this.backButtonTitle ? this.localize('components:wizard:stepper.defaults.back') : this.backButtonTitle}
|
|
160
183
|
</d2l-button>`;
|
|
@@ -167,7 +190,7 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
167
190
|
class="d2l-labs-wizard-step-button-next"
|
|
168
191
|
@click="${this.#handleNextClick}"
|
|
169
192
|
?disabled="${this.disableNextButton}"
|
|
170
|
-
primary
|
|
193
|
+
?primary="${this.primaryButton === PRIMARY_BUTTON.NEXT}"
|
|
171
194
|
title="${!this.nextButtonTooltip ? this.localize('components:wizard:next.button.tooltip') : this.nextButtonTooltip}">
|
|
172
195
|
${!this.nextButtonTitle ? this.localize('components:wizard:stepper.defaults.next') : this.nextButtonTitle}
|
|
173
196
|
</d2l-button>`;
|
|
@@ -178,6 +201,8 @@ class D2LStep extends LocalizeLabsElement(LitElement) {
|
|
|
178
201
|
<d2l-button
|
|
179
202
|
aria-label="${this.restartButtonAriaLabel}"
|
|
180
203
|
@click="${this.#handleRestartClick}"
|
|
204
|
+
?disabled="${this.disableRestartButton}"
|
|
205
|
+
?primary="${this.primaryButton === PRIMARY_BUTTON.RESTART}"
|
|
181
206
|
title="${!this.restartButtonTooltip ? this.localize('components:wizard:restart.button.tooltip') : this.restartButtonTooltip}">
|
|
182
207
|
${!this.restartButtonTitle ? this.localize('components:wizard:stepper.defaults.restart') : this.restartButtonTitle}
|
|
183
208
|
</d2l-button>`;
|