@brightspace-ui/core 1.202.0 → 1.203.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/components/button/README.md +1 -3
- package/components/card/README.md +3 -3
- package/components/count-badge/README.md +0 -92
- package/components/dialog/README.md +3 -10
- package/components/dropdown/README.md +10 -99
- package/components/dropdown/dropdown-content-mixin.js +1 -3
- package/components/filter/README.md +3 -36
- package/components/hierarchical-view/README.md +0 -6
- package/components/html-block/README.md +77 -78
- package/components/html-block/demo/html-block.html +1 -1
- package/components/inputs/docs/input-checkbox.md +1 -2
- package/components/inputs/docs/input-date-time.md +14 -121
- package/components/inputs/docs/input-numeric.md +2 -4
- package/components/inputs/docs/input-search.md +1 -2
- package/components/inputs/docs/input-text.md +2 -4
- package/components/list/README.md +1 -1
- package/components/loading-spinner/loading-spinner.js +2 -6
- package/components/menu/README.md +3 -6
- package/components/meter/README.md +1 -1
- package/components/switch/README.md +1 -3
- package/components/tooltip/README.md +1 -2
- package/package.json +1 -1
|
@@ -38,9 +38,7 @@ The `d2l-button` element can be used just like the native button element, but al
|
|
|
38
38
|

|
|
39
39
|
<!-- docs: end hidden content -->
|
|
40
40
|
|
|
41
|
-
<!-- docs: demo live
|
|
42
|
-
name: d2l-button
|
|
43
|
-
-->
|
|
41
|
+
<!-- docs: demo live name:d2l-button -->
|
|
44
42
|
```html
|
|
45
43
|
<script type="module">
|
|
46
44
|
import '@brightspace-ui/core/components/button/button.js';
|
|
@@ -55,8 +55,8 @@ Cards are composed of 3 sections. Each card will have a content section but is n
|
|
|
55
55
|
```html
|
|
56
56
|
<script type="module">
|
|
57
57
|
import '@brightspace-ui/core/components/card/card.js';
|
|
58
|
-
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
59
58
|
import '@brightspace-ui/core/components/card/card-footer-link.js';
|
|
59
|
+
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
60
60
|
</script>
|
|
61
61
|
|
|
62
62
|
<style>
|
|
@@ -115,8 +115,8 @@ The `d2l-card` element is a container that provides specific layout using severa
|
|
|
115
115
|
```html
|
|
116
116
|
<script type="module">
|
|
117
117
|
import '@brightspace-ui/core/components/card/card.js';
|
|
118
|
-
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
119
118
|
import '@brightspace-ui/core/components/card/card-footer-link.js';
|
|
119
|
+
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
120
120
|
</script>
|
|
121
121
|
|
|
122
122
|
<d2l-card align-center text="Biology" align-center href="#" style="height: 320px; width: 245px;">
|
|
@@ -228,8 +228,8 @@ The `d2l-card-footer-link` element is an icon link that can be placed in the `fo
|
|
|
228
228
|
```html
|
|
229
229
|
<script type="module">
|
|
230
230
|
import '@brightspace-ui/core/components/card/card.js';
|
|
231
|
-
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
232
231
|
import '@brightspace-ui/core/components/card/card-footer-link.js';
|
|
232
|
+
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
233
233
|
</script>
|
|
234
234
|
|
|
235
235
|
<d2l-card align-center text="Biology" align-center href="#" style="height: 320px; width: 245px;">
|
|
@@ -95,96 +95,4 @@ The `d2l-count-badge-icon` element is a web component to display a number count,
|
|
|
95
95
|
| `announce-changes`, default: `false` | Boolean | Optionally choose to announce changes to the badge with an aria-live region. If the text property is changed, the text will be read by screen-readers. |
|
|
96
96
|
| `has-tooltip`, default: `false` | Boolean | Optionally choose to have a tooltip below the badge. |
|
|
97
97
|
| `focus-ring`, default: `false` | Boolean | Optionally force a focus ring around the badge. This property can be used to highlight the badge when the parent element is focused. |
|
|
98
|
-
## Future Enhancements
|
|
99
|
-
|
|
100
|
-
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
101
98
|
<!-- docs: end hidden content -->
|
|
102
|
-
=======
|
|
103
|
-
# Count Badge
|
|
104
|
-
|
|
105
|
-
## d2l-count-badge
|
|
106
|
-
|
|
107
|
-
The `d2l-count-badge` element is a web component to display a number count, either in a `"notification"` or `"count"` style.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-

|
|
111
|
-

|
|
112
|
-
|
|
113
|
-
```html
|
|
114
|
-
<script type="module">
|
|
115
|
-
import '@brightspace-ui/core/components/count-badge/count-badge.js';
|
|
116
|
-
</script>
|
|
117
|
-
<d2l-count-badge size="small" type="notification" text="100 new notifications" number="100"></d2l-count-badge>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**Properties:**
|
|
121
|
-
|
|
122
|
-
| Property | Type | Description |
|
|
123
|
-
|--|--|--|
|
|
124
|
-
| `number` | Number, required | The number to display on the badge. Must be a positive integer. |
|
|
125
|
-
| `size`, default: `small` | String | The size of the badge. Valid options are `"small"` and `"large"`. |
|
|
126
|
-
| `type`, default: `count` | String | The type of the badge. Valid options are `"notification"` and `"count"`. Notification badges are orange and count badges are grey. |
|
|
127
|
-
| `max-digits`, default: `2` when `type="notification"` | Number | Optionally specify a digit limit, after which numbers are truncated. Defaults to two for `"notification"` type and no limit for `"count"` type.
|
|
128
|
-
| `hide-zero`, default: `false` | Boolean | Optionally choose not to show the count badge when the number is zero. |
|
|
129
|
-
| `text`, required | String | Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled. |
|
|
130
|
-
| `tab-stop`, default: `false` | Boolean | Optionally choose to make the badge a tab stop. |
|
|
131
|
-
| `announce-changes`, default: `false` | Boolean | Optionally choose to announce changes to the badge with an aria-live region. If the text property is changed, the text will be read by screen-readers. |
|
|
132
|
-
| `has-tooltip`, default: `false` | Boolean | Optionally choose to have a tooltip below the badge. |
|
|
133
|
-
| `focus-ring`, default: `false` | Boolean | Optionally force a focus ring around the badge. This property can be used to highlight the badge when the parent element is focused. |
|
|
134
|
-
|
|
135
|
-
### Accessibility Properties
|
|
136
|
-
|
|
137
|
-
To make your `d2l-count-badge` accessible, use the following properties when applicable:
|
|
138
|
-
|
|
139
|
-
| Attribute | Description |
|
|
140
|
-
|--|--|
|
|
141
|
-
| `text`, required | Only the text will be read by screen-readers (not the number), so include the number in the text. |
|
|
142
|
-
| `tab-stop` | A tab stop allows screen-reader users to easily tab to the badge. Otherwise, screen-reader users will need to arrow through to the badge. |
|
|
143
|
-
| `announce-changes` | Use "announce-changes" if screen-reader users should be notified that the badge has been updated, such as a new notification. The "text" property will be read as soon as the screen-reader is idle. |
|
|
144
|
-
| `has-tooltip` | The tooltip will be visible on hover/tab-stop, and read out by screen-readers. |
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
## d2l-count-badge-icon
|
|
149
|
-
|
|
150
|
-
The `d2l-count-badge-icon` element is a web component to display a number count, either in a `"notification"` or `"count"` style with an icon.
|
|
151
|
-
|
|
152
|
-

|
|
153
|
-
|
|
154
|
-
```html
|
|
155
|
-
<script type="module">
|
|
156
|
-
import '@brightspace-ui/core/components/count-badge/count-badge-icon.js';
|
|
157
|
-
</script>
|
|
158
|
-
<d2l-count-badge-icon size="small" icon="tier1:gear" type="notification" text="100 new settings applied." number="100"></d2l-count-badge>
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
**Properties:**
|
|
162
|
-
|
|
163
|
-
| Property | Type | Description |
|
|
164
|
-
|--|--|--|
|
|
165
|
-
| `number` | Number, required | The number to display on the badge. Must be a positive integer. |
|
|
166
|
-
| `icon` | String, required | [Preset icon key](../icons#preset-icons) (e.g. `tier1:gear`) |
|
|
167
|
-
| `size`, default: `small` | String | The size of the badge. Valid options are `"small"` and `"large"`. |
|
|
168
|
-
| `type`, default: `count` | String | The type of the badge. Valid options are `"notification"` and `"count"`. Notification badges are orange and count badges are grey. |
|
|
169
|
-
| `max-digits`, default: `2` when `type="notification"` | Number | Optionally specify a digit limit, after which numbers are truncated. Defaults to two for `"notification"` type and no limit for `"count"` type.
|
|
170
|
-
| `hide-zero`, default: `false` | Boolean | Optionally choose not to show the count badge when the number is zero. |
|
|
171
|
-
| `text`, required | String | Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled. |
|
|
172
|
-
| `tab-stop`, default: `false` | Boolean | Optionally choose to make the badge a tab stop. |
|
|
173
|
-
| `announce-changes`, default: `false` | Boolean | Optionally choose to announce changes to the badge with an aria-live region. If the text property is changed, the text will be read by screen-readers. |
|
|
174
|
-
| `has-tooltip`, default: `false` | Boolean | Optionally choose to have a tooltip below the badge. |
|
|
175
|
-
| `focus-ring`, default: `false` | Boolean | Optionally force a focus ring around the badge. This property can be used to highlight the badge when the parent element is focused. |
|
|
176
|
-
|
|
177
|
-
### Accessibility Properties
|
|
178
|
-
|
|
179
|
-
To make your `d2l-count-badge-icon` accessible, use the following properties when applicable:
|
|
180
|
-
|
|
181
|
-
| Attribute | Description |
|
|
182
|
-
|--|--|
|
|
183
|
-
| `text`, required | Only the text will be read by screen-readers (not the number), so include the number in the text. |
|
|
184
|
-
| `tab-stop` | A tab stop allows screen-reader users to easily tab to the badge. Otherwise, screen-reader users will need to arrow through to the badge. |
|
|
185
|
-
| `announce-changes` | Use "announce-changes" if screen-reader users should be notified that the badge has been updated, such as a new notification. The "text" property will be read as soon as the screen-reader is idle. |
|
|
186
|
-
| `has-tooltip` | The tooltip will be visible on hover/tab-stop, and read out by screen-readers. |
|
|
187
|
-
|
|
188
|
-
## Future Enhancements
|
|
189
|
-
|
|
190
|
-
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
@@ -5,18 +5,12 @@ Dialogs interrupt the user to complete a set of tasks, confirm an action, or off
|
|
|
5
5
|
<!-- docs: demo autoSize:false size:large -->
|
|
6
6
|
```html
|
|
7
7
|
<script type="module">
|
|
8
|
+
import './pages/assets/open-first-item-helper.js';
|
|
8
9
|
import '@brightspace-ui/core/components/button/button.js';
|
|
9
10
|
import '@brightspace-ui/core/components/dialog/dialog.js';
|
|
10
|
-
|
|
11
|
-
window.addEventListener('load', function () {
|
|
12
|
-
setTimeout(function() {
|
|
13
|
-
var dialog = document.querySelector('#dialog');
|
|
14
|
-
dialog.opened = true;
|
|
15
|
-
}, 100);
|
|
16
|
-
});
|
|
17
11
|
</script>
|
|
18
12
|
|
|
19
|
-
<d2l-dialog id="dialog" title-text="Dialog Title">
|
|
13
|
+
<d2l-dialog id="dialog-demo" title-text="Dialog Title">
|
|
20
14
|
<div>Some dialog content</div>
|
|
21
15
|
<d2l-button slot="footer" primary data-dialog-action="done">Done</d2l-button>
|
|
22
16
|
<d2l-button slot="footer" data-dialog-action>Cancel</d2l-button>
|
|
@@ -55,8 +49,7 @@ The `d2l-dialog` element is a generic dialog that provides a slot for arbitrary
|
|
|
55
49
|
<script type="module">
|
|
56
50
|
import '@brightspace-ui/core/components/button/button.js';
|
|
57
51
|
import '@brightspace-ui/core/components/dialog/dialog.js';
|
|
58
|
-
|
|
59
|
-
<script>
|
|
52
|
+
|
|
60
53
|
document.querySelector('#open').addEventListener('click', () => {
|
|
61
54
|
document.querySelector('#dialog').opened = true;
|
|
62
55
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Dropdowns
|
|
2
2
|
A Dropdown is a button that opens a floating container to offer menu items or other content.
|
|
3
|
+
|
|
3
4
|
<!-- docs: demo autoSize:false align:flex-start size:medium -->
|
|
4
5
|
```html
|
|
5
6
|
<script type="module">
|
|
6
7
|
import '@brightspace-ui/core/components/dropdown/dropdown-button.js';
|
|
7
8
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
8
|
-
|
|
9
|
-
<script>
|
|
9
|
+
|
|
10
10
|
window.addEventListener('load', function () {
|
|
11
11
|
var demoElem = document.querySelector('#demo-element');
|
|
12
12
|
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
@@ -29,21 +29,10 @@ A Dropdown is a button that opens a floating container to offer menu items or ot
|
|
|
29
29
|
<!-- docs: demo live name:d2l-dropdown autoSize:false align:flex-start size:medium -->
|
|
30
30
|
```html
|
|
31
31
|
<script type="module">
|
|
32
|
+
import './pages/assets/open-first-item-helper.js';
|
|
32
33
|
import '@brightspace-ui/core/components/dropdown/dropdown.js';
|
|
33
34
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
34
35
|
</script>
|
|
35
|
-
<!-- docs: start hidden content -->
|
|
36
|
-
<script>
|
|
37
|
-
window.addEventListener('load', function () {
|
|
38
|
-
var demoElem = document.querySelector('#demo-element');
|
|
39
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
var dropdown = document.querySelector('d2l-dropdown');
|
|
42
|
-
dropdown.toggleOpen();
|
|
43
|
-
}, 100);
|
|
44
|
-
});
|
|
45
|
-
</script>
|
|
46
|
-
<!-- docs: end hidden content -->
|
|
47
36
|
<d2l-dropdown>
|
|
48
37
|
<button class="d2l-dropdown-opener">Open!</button>
|
|
49
38
|
<d2l-dropdown-content>
|
|
@@ -86,21 +75,10 @@ If the dropdown is initially empty when it's opened, the dropdown pointer will n
|
|
|
86
75
|
<!-- docs: demo live name:d2l-dropdown-button autoSize:false align:flex-start size:medium -->
|
|
87
76
|
```html
|
|
88
77
|
<script type="module">
|
|
78
|
+
import './pages/assets/open-first-item-helper.js';
|
|
89
79
|
import '@brightspace-ui/core/components/dropdown/dropdown-button.js';
|
|
90
80
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
91
81
|
</script>
|
|
92
|
-
<!-- docs: start hidden content -->
|
|
93
|
-
<script>
|
|
94
|
-
window.addEventListener('load', function () {
|
|
95
|
-
var demoElem = document.querySelector('#demo-element');
|
|
96
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
97
|
-
setTimeout(() => {
|
|
98
|
-
var dropdown = document.querySelector('d2l-dropdown-button');
|
|
99
|
-
dropdown.toggleOpen();
|
|
100
|
-
}, 100);
|
|
101
|
-
});
|
|
102
|
-
</script>
|
|
103
|
-
<!-- docs: end hidden content -->
|
|
104
82
|
<d2l-dropdown-button text="Open!">
|
|
105
83
|
<d2l-dropdown-content>
|
|
106
84
|
Some content...
|
|
@@ -130,21 +108,10 @@ If the dropdown is initially empty when it's opened, the dropdown pointer will n
|
|
|
130
108
|
<!-- docs: demo live name:d2l-dropdown-button-subtle align:flex-start autoSize:false size:medium -->
|
|
131
109
|
```html
|
|
132
110
|
<script type="module">
|
|
111
|
+
import './pages/assets/open-first-item-helper.js';
|
|
133
112
|
import '@brightspace-ui/core/components/dropdown/dropdown-button-subtle.js';
|
|
134
113
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
135
114
|
</script>
|
|
136
|
-
<!-- docs: start hidden content -->
|
|
137
|
-
<script>
|
|
138
|
-
window.addEventListener('load', function () {
|
|
139
|
-
var demoElem = document.querySelector('#demo-element');
|
|
140
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
141
|
-
setTimeout(() => {
|
|
142
|
-
var dropdown = document.querySelector('d2l-dropdown-button-subtle');
|
|
143
|
-
dropdown.toggleOpen();
|
|
144
|
-
}, 100);
|
|
145
|
-
});
|
|
146
|
-
</script>
|
|
147
|
-
<!-- docs: end hidden content -->
|
|
148
115
|
<d2l-dropdown-button-subtle text="Open!">
|
|
149
116
|
<d2l-dropdown-content>
|
|
150
117
|
Some content...
|
|
@@ -182,21 +149,10 @@ To make your `d2l-dropdown-button-subtle` accessible, use the following properti
|
|
|
182
149
|
<!-- docs: demo live name:d2l-dropdown-context-menu align:flex-start autoSize:false size:medium -->
|
|
183
150
|
```html
|
|
184
151
|
<script type="module">
|
|
152
|
+
import './pages/assets/open-first-item-helper.js';
|
|
185
153
|
import '@brightspace-ui/core/components/dropdown/dropdown-context-menu.js';
|
|
186
154
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
187
155
|
</script>
|
|
188
|
-
<!-- docs: start hidden content -->
|
|
189
|
-
<script>
|
|
190
|
-
window.addEventListener('load', function () {
|
|
191
|
-
var demoElem = document.querySelector('#demo-element');
|
|
192
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
193
|
-
setTimeout(() => {
|
|
194
|
-
var dropdown = document.querySelector('d2l-dropdown-context-menu');
|
|
195
|
-
dropdown.toggleOpen();
|
|
196
|
-
}, 100);
|
|
197
|
-
});
|
|
198
|
-
</script>
|
|
199
|
-
<!-- docs: end hidden content -->
|
|
200
156
|
<d2l-dropdown-context-menu text="Open!">
|
|
201
157
|
<d2l-dropdown-content>
|
|
202
158
|
Some content...
|
|
@@ -235,21 +191,10 @@ To make your usage of `d2l-dropdown-context-menu` accessible, use the following
|
|
|
235
191
|
<!-- docs: demo live name:d2l-dropdown-more autoSize:false align:flex-start size:medium -->
|
|
236
192
|
```html
|
|
237
193
|
<script type="module">
|
|
194
|
+
import './pages/assets/open-first-item-helper.js';
|
|
238
195
|
import '@brightspace-ui/core/components/dropdown/dropdown-more.js';
|
|
239
196
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
240
197
|
</script>
|
|
241
|
-
<!-- docs: start hidden content -->
|
|
242
|
-
<script>
|
|
243
|
-
window.addEventListener('load', function () {
|
|
244
|
-
var demoElem = document.querySelector('#demo-element');
|
|
245
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
246
|
-
setTimeout(() => {
|
|
247
|
-
var dropdown = document.querySelector('d2l-dropdown-more');
|
|
248
|
-
dropdown.toggleOpen();
|
|
249
|
-
}, 100);
|
|
250
|
-
});
|
|
251
|
-
</script>
|
|
252
|
-
<!-- docs: end hidden content -->
|
|
253
198
|
<d2l-dropdown-more text="Open!">
|
|
254
199
|
<d2l-dropdown-content>
|
|
255
200
|
Some content...
|
|
@@ -289,21 +234,10 @@ To make your usage of `d2l-dropdown-more` accessible, use the following property
|
|
|
289
234
|
<!-- docs: demo live name:d2l-dropdown-content autoSize:false align:flex-start size:medium -->
|
|
290
235
|
```html
|
|
291
236
|
<script type="module">
|
|
237
|
+
import './pages/assets/open-first-item-helper.js';
|
|
292
238
|
import '@brightspace-ui/core/components/dropdown/dropdown-button.js';
|
|
293
239
|
import '@brightspace-ui/core/components/dropdown/dropdown-content.js';
|
|
294
240
|
</script>
|
|
295
|
-
<!-- docs: start hidden content -->
|
|
296
|
-
<script>
|
|
297
|
-
window.addEventListener('load', function () {
|
|
298
|
-
var demoElem = document.querySelector('#demo-element');
|
|
299
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
300
|
-
setTimeout(() => {
|
|
301
|
-
var dropdown = document.querySelector('d2l-dropdown-button');
|
|
302
|
-
dropdown.toggleOpen();
|
|
303
|
-
}, 100);
|
|
304
|
-
});
|
|
305
|
-
</script>
|
|
306
|
-
<!-- docs: end hidden content -->
|
|
307
241
|
<d2l-dropdown-button text="Open!" primary>
|
|
308
242
|
<d2l-dropdown-content min-width="150" max-width="400" mobile-tray="bottom">
|
|
309
243
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
@@ -363,26 +297,14 @@ To make your usage of `d2l-dropdown-more` accessible, use the following property
|
|
|
363
297
|
<!-- docs: demo live name:d2l-dropdown-menu size:medium align:flex-start autoSize:false -->
|
|
364
298
|
```html
|
|
365
299
|
<script type="module">
|
|
300
|
+
import './pages/assets/open-first-item-helper.js';
|
|
366
301
|
import '@brightspace-ui/core/components/dropdown/dropdown-button.js';
|
|
367
302
|
import '@brightspace-ui/core/components/dropdown/dropdown-menu.js';
|
|
368
303
|
import '@brightspace-ui/core/components/menu/menu.js';
|
|
369
304
|
import '@brightspace-ui/core/components/menu/menu-item.js';
|
|
370
305
|
import '@brightspace-ui/core/components/tabs/tabs.js';
|
|
371
306
|
import '@brightspace-ui/core/components/tabs/tab-panel.js';
|
|
372
|
-
|
|
373
307
|
</script>
|
|
374
|
-
<!-- docs: start hidden content -->
|
|
375
|
-
<script>
|
|
376
|
-
window.addEventListener('load', function () {
|
|
377
|
-
var demoElem = document.querySelector('#demo-element');
|
|
378
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
379
|
-
setTimeout(() => {
|
|
380
|
-
var dropdown = document.querySelector('d2l-dropdown-button');
|
|
381
|
-
dropdown.toggleOpen();
|
|
382
|
-
}, 100);
|
|
383
|
-
});
|
|
384
|
-
</script>
|
|
385
|
-
<!-- docs: end hidden content -->
|
|
386
308
|
<d2l-dropdown-button text="Open!" primary>
|
|
387
309
|
<d2l-dropdown-menu>
|
|
388
310
|
<d2l-menu label="Astronomy">
|
|
@@ -419,6 +341,7 @@ To make your usage of `d2l-dropdown-more` accessible, use the following property
|
|
|
419
341
|
<!-- docs: demo live name:d2l-dropdown-tabs size:large autoSize:false align:flex-start -->
|
|
420
342
|
```html
|
|
421
343
|
<script type="module">
|
|
344
|
+
import './pages/assets/open-first-item-helper.js';
|
|
422
345
|
import '@brightspace-ui/core/components/dropdown/dropdown-button.js';
|
|
423
346
|
import '@brightspace-ui/core/components/dropdown/dropdown-tabs.js';
|
|
424
347
|
import '@brightspace-ui/core/components/menu/menu.js';
|
|
@@ -426,18 +349,6 @@ To make your usage of `d2l-dropdown-more` accessible, use the following property
|
|
|
426
349
|
import '@brightspace-ui/core/components/tabs/tabs.js';
|
|
427
350
|
import '@brightspace-ui/core/components/tabs/tab-panel.js';
|
|
428
351
|
</script>
|
|
429
|
-
<!-- docs: start hidden content -->
|
|
430
|
-
<script>
|
|
431
|
-
window.addEventListener('load', function () {
|
|
432
|
-
var demoElem = document.querySelector('#demo-element');
|
|
433
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
434
|
-
setTimeout(() => {
|
|
435
|
-
var dropdown = document.querySelector('d2l-dropdown-button');
|
|
436
|
-
dropdown.toggleOpen();
|
|
437
|
-
}, 100);
|
|
438
|
-
});
|
|
439
|
-
</script>
|
|
440
|
-
<!-- docs: end hidden content -->
|
|
441
352
|
<d2l-dropdown-button text="Open!" primary>
|
|
442
353
|
<d2l-dropdown-tabs min-width="175" max-width="300">
|
|
443
354
|
<d2l-tabs>
|
|
@@ -325,9 +325,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
325
325
|
if (isNaN(newVerticalOffset)) {
|
|
326
326
|
newVerticalOffset = 20;
|
|
327
327
|
}
|
|
328
|
-
|
|
329
|
-
if (window.ShadyCSS) window.ShadyCSS.styleSubtree(this, { '--d2l-dropdown-verticaloffset': `${newVerticalOffset}px` });
|
|
330
|
-
else this.style.setProperty('--d2l-dropdown-verticaloffset', `${newVerticalOffset}px`);
|
|
328
|
+
this.style.setProperty('--d2l-dropdown-verticaloffset', `${newVerticalOffset}px`);
|
|
331
329
|
}
|
|
332
330
|
});
|
|
333
331
|
}
|
|
@@ -10,22 +10,11 @@ Filter with multiple dimensions:
|
|
|
10
10
|
<!-- docs: demo align:start autoSize:false size:large -->
|
|
11
11
|
```html
|
|
12
12
|
<script type="module">
|
|
13
|
+
import './pages/assets/open-first-item-helper.js';
|
|
13
14
|
import '@brightspace-ui/core/components/filter/filter.js';
|
|
14
15
|
import '@brightspace-ui/core/components/filter/filter-dimension-set.js';
|
|
15
16
|
import '@brightspace-ui/core/components/filter/filter-dimension-set-value.js';
|
|
16
17
|
</script>
|
|
17
|
-
<!-- docs: start hidden content -->
|
|
18
|
-
<script>
|
|
19
|
-
window.addEventListener('load', function () {
|
|
20
|
-
var demoElem = document.querySelector('#demo-element');
|
|
21
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
22
|
-
setTimeout(() => {
|
|
23
|
-
var filter = document.querySelector('d2l-filter');
|
|
24
|
-
filter.opened = true;
|
|
25
|
-
}, 100);
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
<!-- docs: end hidden content -->
|
|
29
18
|
<d2l-filter>
|
|
30
19
|
<d2l-filter-dimension-set key="course" text="Course">
|
|
31
20
|
<d2l-filter-dimension-set-value key="art" text="Art"></d2l-filter-dimension-set-value>
|
|
@@ -53,22 +42,11 @@ The `d2l-filter` component allows a user to filter on one or more dimensions of
|
|
|
53
42
|
<!-- docs: demo live name:d2l-filter autoSize:false align:start size:large -->
|
|
54
43
|
```html
|
|
55
44
|
<script type="module">
|
|
45
|
+
import './pages/assets/open-first-item-helper.js';
|
|
56
46
|
import '@brightspace-ui/core/components/filter/filter.js';
|
|
57
47
|
import '@brightspace-ui/core/components/filter/filter-dimension-set.js';
|
|
58
48
|
import '@brightspace-ui/core/components/filter/filter-dimension-set-value.js';
|
|
59
49
|
</script>
|
|
60
|
-
<!-- docs: start hidden content -->
|
|
61
|
-
<script>
|
|
62
|
-
window.addEventListener('load', function () {
|
|
63
|
-
var demoElem = document.querySelector('#demo-element');
|
|
64
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
var filter = document.querySelector('d2l-filter');
|
|
67
|
-
filter.opened = true;
|
|
68
|
-
}, 100);
|
|
69
|
-
});
|
|
70
|
-
</script>
|
|
71
|
-
<!-- docs: end hidden content -->
|
|
72
50
|
<d2l-filter>
|
|
73
51
|
<d2l-filter-dimension-set key="course" text="Course">
|
|
74
52
|
<d2l-filter-dimension-set-value key="art" text="Art"></d2l-filter-dimension-set-value>
|
|
@@ -185,22 +163,11 @@ Set dimension on mobile:
|
|
|
185
163
|
<!-- docs: demo live name:d2l-filter-dimension-set align:start autoSize:false size:large -->
|
|
186
164
|
```html
|
|
187
165
|
<script type="module">
|
|
166
|
+
import './pages/assets/open-first-item-helper.js';
|
|
188
167
|
import '@brightspace-ui/core/components/filter/filter.js';
|
|
189
168
|
import '@brightspace-ui/core/components/filter/filter-dimension-set.js';
|
|
190
169
|
import '@brightspace-ui/core/components/filter/filter-dimension-set-value.js';
|
|
191
170
|
</script>
|
|
192
|
-
<!-- docs: start hidden content -->
|
|
193
|
-
<script>
|
|
194
|
-
window.addEventListener('load', function () {
|
|
195
|
-
var demoElem = document.querySelector('#demo-element');
|
|
196
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
197
|
-
setTimeout(() => {
|
|
198
|
-
var filter = document.querySelector('d2l-filter');
|
|
199
|
-
filter.opened = true;
|
|
200
|
-
}, 100);
|
|
201
|
-
});
|
|
202
|
-
</script>
|
|
203
|
-
<!-- docs: end hidden content -->
|
|
204
171
|
<d2l-filter>
|
|
205
172
|
<d2l-filter-dimension-set key="course" text="Course" >
|
|
206
173
|
<d2l-filter-dimension-set-value key="art" text="Art" selected><d2l-filter-dimension-set-value>
|
|
@@ -241,9 +241,3 @@ class MyComponent extends HierarchicalViewMixin(LitElement) {
|
|
|
241
241
|
- `d2l-hierarchical-view-show-complete`: dispatched when child view is shown (when animation ends)
|
|
242
242
|
- `d2l-hierarchical-view-hide-start`: dispatched when child view will be hidden (before animation begins)
|
|
243
243
|
- `d2l-hierarchical-view-hide-complete`: dispatched when child view is hidden (when animation ends)
|
|
244
|
-
|
|
245
|
-
<!-- docs: start hidden content -->
|
|
246
|
-
## Future Enhancements
|
|
247
|
-
|
|
248
|
-
Looking for an enhancement not listed here? Create a GitHub issue!
|
|
249
|
-
<!-- docs: end hidden content -->
|
|
@@ -15,34 +15,34 @@ Place the user-authored HTML within a `template` and the `d2l-html-block` will s
|
|
|
15
15
|
import '@brightspace-ui/core/components/icons/icon.js';
|
|
16
16
|
</script>
|
|
17
17
|
<d2l-html-block>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
<template>
|
|
19
|
+
<!-- docs: start hidden content -->
|
|
20
|
+
<style>
|
|
21
|
+
div {
|
|
22
|
+
--d2l-icon-fill-color: var(--d2l-color-cinnabar);
|
|
23
|
+
}
|
|
24
|
+
span {
|
|
25
|
+
color: var(--d2l-color-cinnabar);
|
|
26
|
+
margin-left: 10px;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
}
|
|
29
|
+
d2l-icon {
|
|
30
|
+
align-self: center;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
}
|
|
33
|
+
.warning-container {
|
|
34
|
+
align-items: center;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
39
|
<!-- docs: end hidden content --><div class="warning-container">
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
<d2l-icon icon="tier3:alert"></d2l-icon>
|
|
41
|
+
<span>
|
|
42
|
+
<b>Important:</b> user-authored HTML must be trusted or properly sanitized!
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
46
|
</d2l-html-block>
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -50,20 +50,20 @@ To use `d2l-html-block` within another Lit component, use the [unsafeHTML](https
|
|
|
50
50
|
|
|
51
51
|
```html
|
|
52
52
|
<script type="module">
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
import { html, LitElement } from 'lit-element/lit-element.js';
|
|
54
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
55
|
+
import '@brightspace-ui/core/components/icons/icon.js';
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
class SomeComponent extends LitElement {
|
|
58
|
+
render() {
|
|
59
|
+
return html`
|
|
60
|
+
<d2l-html-block>
|
|
61
|
+
<template>${unsafeHTML(this._unsafeHTML)}</template>
|
|
62
|
+
</d2l-html-block>`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
customElements.define('d2l-some-component', SomeComponent);
|
|
67
67
|
</script>
|
|
68
68
|
<d2l-some-component></d2l-some-component>
|
|
69
69
|
```
|
|
@@ -79,27 +79,27 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
79
79
|
import '@brightspace-ui/core/components/icons/icon.js';
|
|
80
80
|
</script>
|
|
81
81
|
<d2l-html-block>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
<template>
|
|
83
|
+
<div class="mathml-container">
|
|
84
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
85
|
+
<msqrt>
|
|
86
|
+
<mn>3</mn>
|
|
87
|
+
<mi>x</mi>
|
|
88
|
+
<mo>−</mo>
|
|
89
|
+
<mn>1</mn>
|
|
90
|
+
</msqrt>
|
|
91
|
+
<mo>+</mo>
|
|
92
|
+
<mo stretchy="false">(</mo>
|
|
93
|
+
<mn>1</mn>
|
|
94
|
+
<mo>+</mo>
|
|
95
|
+
<mi>x</mi>
|
|
96
|
+
<msup>
|
|
97
|
+
<mo stretchy="false">)</mo>
|
|
98
|
+
<mn>2</mn>
|
|
99
|
+
</msup>
|
|
100
|
+
</math>
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
103
|
</d2l-html-block>
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -109,26 +109,25 @@ Examples are provided to display how user-authored math can be embedded within y
|
|
|
109
109
|
```html
|
|
110
110
|
<script type="module">
|
|
111
111
|
import '@brightspace-ui/core/components/html-block/html-block.js';
|
|
112
|
-
import '@brightspace-ui/core/components/icons/icon.js';
|
|
113
112
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
window.D2L = {};
|
|
114
|
+
D2L.LP = {};
|
|
115
|
+
D2L.LP.Web = {};
|
|
116
|
+
D2L.LP.Web.UI = {};
|
|
117
|
+
D2L.LP.Web.UI.Flags = {
|
|
118
|
+
Flag: (feature, defaultValue) => {
|
|
119
|
+
if (feature === 'us125413-mathjax-render-latex') return true;
|
|
120
|
+
else return defaultValue;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
<!-- docs: start hidden content -->
|
|
124
|
+
document.getElementsByTagName('html')[0].dataset.mathjaxContext = JSON.stringify({ renderLatex: true });<!-- docs: end hidden content -->
|
|
126
125
|
</script>
|
|
127
126
|
<d2l-html-block>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
<template>
|
|
128
|
+
<div class="latex-container">
|
|
129
|
+
$$ f(x) = \int \mathrm{e}^{-x}\,\mathrm{d}x $$ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
133
132
|
</d2l-html-block>
|
|
134
133
|
```
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</script>
|
|
40
40
|
<script>
|
|
41
41
|
if (window.location.search.indexOf('latex=true') !== -1) {
|
|
42
|
-
document.getElementsByTagName('html')[0].dataset.mathjaxContext = JSON.stringify({
|
|
42
|
+
document.getElementsByTagName('html')[0].dataset.mathjaxContext = JSON.stringify({ renderLatex: true });
|
|
43
43
|
}
|
|
44
44
|
</script>
|
|
45
45
|
</head>
|
|
@@ -43,8 +43,7 @@ The `<d2l-input-checkbox>` element can be used to get a checkbox and optional vi
|
|
|
43
43
|
```html
|
|
44
44
|
<script type="module">
|
|
45
45
|
import '@brightspace-ui/core/components/inputs/input-checkbox.js';
|
|
46
|
-
|
|
47
|
-
<script>
|
|
46
|
+
|
|
48
47
|
window.addEventListener('load', function () {
|
|
49
48
|
var input = document.querySelector('#checkbox');
|
|
50
49
|
input.addEventListener('change', (e) => {
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Use date and time inputs to set dates and times in forms. They are available as separate inputs (date or time) or as a combined date & time input, and each of them is also available as a range.
|
|
4
4
|
|
|
5
|
-
<!-- docs: demo
|
|
6
|
-
align:flex-start
|
|
7
|
-
autoSize:false
|
|
8
|
-
size:xlarge
|
|
9
|
-
-->
|
|
5
|
+
<!-- docs: demo align:flex-start autoSize:false size:xlarge -->
|
|
10
6
|
```html
|
|
11
7
|
<script type="module">
|
|
12
8
|
import '@brightspace-ui/core/components/inputs/input-date.js';
|
|
13
9
|
import '@brightspace-ui/core/components/inputs/input-time.js';
|
|
14
|
-
|
|
15
|
-
<script>
|
|
10
|
+
|
|
16
11
|
window.addEventListener('load', function () {
|
|
17
12
|
var demoElem = document.querySelector('#demo-element');
|
|
18
13
|
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
@@ -50,29 +45,12 @@ Note: All `*value` properties should be in ISO 8601 calendar date format (`YYYY-
|
|
|
50
45
|

|
|
51
46
|
<!-- docs: end hidden content -->
|
|
52
47
|
|
|
53
|
-
<!-- docs: demo live
|
|
54
|
-
name:d2l-input-date
|
|
55
|
-
align:flex-start
|
|
56
|
-
autoSize:false
|
|
57
|
-
size:xlarge
|
|
58
|
-
-->
|
|
48
|
+
<!-- docs: demo live name:d2l-input-date align:flex-start autoSize:false size:xlarge -->
|
|
59
49
|
```html
|
|
60
50
|
<script type="module">
|
|
51
|
+
import './pages/assets/open-first-item-helper.js';
|
|
61
52
|
import '@brightspace-ui/core/components/inputs/input-date.js';
|
|
62
53
|
</script>
|
|
63
|
-
<!-- docs: start hidden content -->
|
|
64
|
-
<script>
|
|
65
|
-
window.addEventListener('load', function () {
|
|
66
|
-
var demoElem = document.querySelector('#demo-element');
|
|
67
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
68
|
-
|
|
69
|
-
setTimeout(function() {
|
|
70
|
-
var input = document.querySelector('d2l-input-date');
|
|
71
|
-
input.opened = true;
|
|
72
|
-
}, 100);
|
|
73
|
-
});
|
|
74
|
-
</script>
|
|
75
|
-
<!-- docs: end hidden content -->
|
|
76
54
|
<d2l-input-date label="Birthdate">
|
|
77
55
|
</d2l-input-date>
|
|
78
56
|
```
|
|
@@ -118,29 +96,12 @@ Note: All `*value` properties should be in ISO 8601 calendar date format (`YYYY-
|
|
|
118
96
|

|
|
119
97
|
<!-- docs: end hidden content -->
|
|
120
98
|
|
|
121
|
-
<!-- docs: demo live
|
|
122
|
-
name:d2l-input-date-range
|
|
123
|
-
align:flex-start
|
|
124
|
-
autoSize:false
|
|
125
|
-
size:xlarge
|
|
126
|
-
-->
|
|
99
|
+
<!-- docs: demo live name:d2l-input-date-range align:flex-start autoSize:false size:xlarge -->
|
|
127
100
|
```html
|
|
128
101
|
<script type="module">
|
|
102
|
+
import './pages/assets/open-first-item-helper.js';
|
|
129
103
|
import '@brightspace-ui/core/components/inputs/input-date-range.js';
|
|
130
104
|
</script>
|
|
131
|
-
<!-- docs: start hidden content -->
|
|
132
|
-
<script>
|
|
133
|
-
window.addEventListener('load', function () {
|
|
134
|
-
var demoElem = document.querySelector('#demo-element');
|
|
135
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
136
|
-
|
|
137
|
-
setTimeout(function() {
|
|
138
|
-
var input = document.querySelector('d2l-input-date-range');
|
|
139
|
-
input.startOpened = true;
|
|
140
|
-
}, 100);
|
|
141
|
-
});
|
|
142
|
-
</script>
|
|
143
|
-
<!-- docs: end hidden content -->
|
|
144
105
|
<d2l-input-date-range label="Availability Range">
|
|
145
106
|
</d2l-input-date-range>
|
|
146
107
|
```
|
|
@@ -192,29 +153,12 @@ Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and
|
|
|
192
153
|

|
|
193
154
|
<!-- docs: end hidden content -->
|
|
194
155
|
|
|
195
|
-
<!-- docs: demo live
|
|
196
|
-
name:d2l-input-time
|
|
197
|
-
align:flex-start
|
|
198
|
-
autoSize:false
|
|
199
|
-
size:large
|
|
200
|
-
-->
|
|
156
|
+
<!-- docs: demo live name:d2l-input-time align:flex-start autoSize:false size:large -->
|
|
201
157
|
```html
|
|
202
158
|
<script type="module">
|
|
159
|
+
import './pages/assets/open-first-item-helper.js';
|
|
203
160
|
import '@brightspace-ui/core/components/inputs/input-time.js';
|
|
204
161
|
</script>
|
|
205
|
-
<!-- docs: start hidden content -->
|
|
206
|
-
<script>
|
|
207
|
-
window.addEventListener('load', function () {
|
|
208
|
-
var demoElem = document.querySelector('#demo-element');
|
|
209
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
210
|
-
|
|
211
|
-
setTimeout(function() {
|
|
212
|
-
var input = document.querySelector('d2l-input-time');
|
|
213
|
-
input.opened = true;
|
|
214
|
-
}, 100);
|
|
215
|
-
});
|
|
216
|
-
</script>
|
|
217
|
-
<!-- docs: end hidden content -->
|
|
218
162
|
<d2l-input-time label="Time">
|
|
219
163
|
</d2l-input-time>
|
|
220
164
|
```
|
|
@@ -260,29 +204,12 @@ Note: All `*value` properties should be in ISO 8601 time format (`hh:mm:ss`) and
|
|
|
260
204
|

|
|
261
205
|
<!-- docs: end hidden content -->
|
|
262
206
|
|
|
263
|
-
<!-- docs: demo live
|
|
264
|
-
name:d2l-input-time-range
|
|
265
|
-
align:flex-start
|
|
266
|
-
autoSize:false
|
|
267
|
-
size:large
|
|
268
|
-
-->
|
|
207
|
+
<!-- docs: demo live name:d2l-input-time-range align:flex-start autoSize:false size:large -->
|
|
269
208
|
```html
|
|
270
209
|
<script type="module">
|
|
210
|
+
import './pages/assets/open-first-item-helper.js';
|
|
271
211
|
import '@brightspace-ui/core/components/inputs/input-time-range.js';
|
|
272
212
|
</script>
|
|
273
|
-
<!-- docs: start hidden content -->
|
|
274
|
-
<script>
|
|
275
|
-
window.addEventListener('load', function () {
|
|
276
|
-
var demoElem = document.querySelector('#demo-element');
|
|
277
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
278
|
-
|
|
279
|
-
setTimeout(function() {
|
|
280
|
-
var input = document.querySelector('d2l-input-time-range');
|
|
281
|
-
input.startOpened = true;
|
|
282
|
-
}, 100);
|
|
283
|
-
});
|
|
284
|
-
</script>
|
|
285
|
-
<!-- docs: end hidden content -->
|
|
286
213
|
<d2l-input-time-range label="Availability Range">
|
|
287
214
|
</d2l-input-time-range>
|
|
288
215
|
```
|
|
@@ -330,29 +257,12 @@ Note: All `*value` properties should be in ISO 8601 combined date and time forma
|
|
|
330
257
|

|
|
331
258
|
<!-- docs: end hidden content -->
|
|
332
259
|
|
|
333
|
-
<!-- docs: demo live
|
|
334
|
-
name:d2l-input-date-time
|
|
335
|
-
align:flex-start
|
|
336
|
-
autoSize:false
|
|
337
|
-
size:xlarge
|
|
338
|
-
-->
|
|
260
|
+
<!-- docs: demo live name:d2l-input-date-time align:flex-start autoSize:false size:xlarge -->
|
|
339
261
|
```html
|
|
340
262
|
<script type="module">
|
|
263
|
+
import './pages/assets/open-first-item-helper.js';
|
|
341
264
|
import '@brightspace-ui/core/components/inputs/input-date-time.js';
|
|
342
265
|
</script>
|
|
343
|
-
<!-- docs: start hidden content -->
|
|
344
|
-
<script>
|
|
345
|
-
window.addEventListener('load', function () {
|
|
346
|
-
var demoElem = document.querySelector('#demo-element');
|
|
347
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
348
|
-
|
|
349
|
-
setTimeout(function() {
|
|
350
|
-
var input = document.querySelector('d2l-input-date-time');
|
|
351
|
-
input.opened = true;
|
|
352
|
-
}, 100);
|
|
353
|
-
});
|
|
354
|
-
</script>
|
|
355
|
-
<!-- docs: end hidden content -->
|
|
356
266
|
<d2l-input-date-time label="Due Date">
|
|
357
267
|
</d2l-input-date-time>
|
|
358
268
|
```
|
|
@@ -399,29 +309,12 @@ Note: All `*value` properties should be in ISO 8601 combined date and time forma
|
|
|
399
309
|

|
|
400
310
|
<!-- docs: end hidden content -->
|
|
401
311
|
|
|
402
|
-
<!-- docs: demo live
|
|
403
|
-
name:d2l-input-date-time-range
|
|
404
|
-
align:flex-start
|
|
405
|
-
autoSize:false
|
|
406
|
-
size:xlarge
|
|
407
|
-
-->
|
|
312
|
+
<!-- docs: demo live name:d2l-input-date-time-range align:flex-start autoSize:false size:xlarge -->
|
|
408
313
|
```html
|
|
409
314
|
<script type="module">
|
|
315
|
+
import './pages/assets/open-first-item-helper.js';
|
|
410
316
|
import '@brightspace-ui/core/components/inputs/input-date-time-range.js';
|
|
411
317
|
</script>
|
|
412
|
-
<!-- docs: start hidden content -->
|
|
413
|
-
<script>
|
|
414
|
-
window.addEventListener('load', function () {
|
|
415
|
-
var demoElem = document.querySelector('#demo-element');
|
|
416
|
-
if (!demoElem.hasAttribute('data-first-load')) return;
|
|
417
|
-
|
|
418
|
-
setTimeout(function() {
|
|
419
|
-
var input = document.querySelector('d2l-input-date-time-range');
|
|
420
|
-
input.startOpened = true;
|
|
421
|
-
}, 100);
|
|
422
|
-
});
|
|
423
|
-
</script>
|
|
424
|
-
<!-- docs: end hidden content -->
|
|
425
318
|
<d2l-input-date-time-range label="Availability Range">
|
|
426
319
|
</d2l-input-date-time-range>
|
|
427
320
|
```
|
|
@@ -29,8 +29,7 @@ The `<d2l-input-number>` element is similar to `<d2l-input-text>`, except it's i
|
|
|
29
29
|
```html
|
|
30
30
|
<script type="module">
|
|
31
31
|
import '@brightspace-ui/core/components/inputs/input-number.js';
|
|
32
|
-
|
|
33
|
-
<script>
|
|
32
|
+
|
|
34
33
|
window.addEventListener('load', function () {
|
|
35
34
|
var input = document.querySelector('#number');
|
|
36
35
|
input.addEventListener('change', (e) => {
|
|
@@ -112,8 +111,7 @@ The `<d2l-input-percent>` element is similar to `<d2l-input-number>`, except it
|
|
|
112
111
|
```html
|
|
113
112
|
<script type="module">
|
|
114
113
|
import '@brightspace-ui/core/components/inputs/input-percent.js';
|
|
115
|
-
|
|
116
|
-
<script>
|
|
114
|
+
|
|
117
115
|
window.addEventListener('load', function () {
|
|
118
116
|
var input = document.querySelector('#percent');
|
|
119
117
|
input.addEventListener('change', (e) => {
|
|
@@ -43,8 +43,7 @@ For text searches use `<d2l-input-search>`, which wraps the native `<input type=
|
|
|
43
43
|
```html
|
|
44
44
|
<script type="module">
|
|
45
45
|
import '@brightspace-ui/core/components/inputs/input-search.js';
|
|
46
|
-
|
|
47
|
-
<script>
|
|
46
|
+
|
|
48
47
|
window.addEventListener('load', function () {
|
|
49
48
|
document.querySelector('#search').addEventListener('d2l-input-search-searched', (e) => {
|
|
50
49
|
console.log('searched term:', e.detail.value);
|
|
@@ -57,8 +57,7 @@ The `<d2l-input-text>` element is a simple wrapper around the native `<input typ
|
|
|
57
57
|
```html
|
|
58
58
|
<script type="module">
|
|
59
59
|
import '@brightspace-ui/core/components/inputs/input-text.js';
|
|
60
|
-
|
|
61
|
-
<script>
|
|
60
|
+
|
|
62
61
|
window.addEventListener('load', function () {
|
|
63
62
|
var input = document.querySelector('#text');
|
|
64
63
|
input.addEventListener('change', (e) => {
|
|
@@ -181,8 +180,7 @@ The `<d2l-input-textarea>` is a wrapper around the native `<textarea>` element t
|
|
|
181
180
|
```html
|
|
182
181
|
<script type="module">
|
|
183
182
|
import '@brightspace-ui/core/components/inputs/input-textarea.js';
|
|
184
|
-
|
|
185
|
-
<script>
|
|
183
|
+
|
|
186
184
|
window.addEventListener('load', function () {
|
|
187
185
|
var input = document.querySelector('#textarea');
|
|
188
186
|
input.addEventListener('change', (e) => {
|
|
@@ -5,8 +5,8 @@ A list displays a collection of objects of the same type. A list is primarily us
|
|
|
5
5
|
<!-- docs: demo autoSize:false size:large -->
|
|
6
6
|
```html
|
|
7
7
|
<script type="module">
|
|
8
|
-
import '@brightspace-ui/core/components/dropdown/dropdown-more.js';
|
|
9
8
|
import '@brightspace-ui/core/components/dropdown/dropdown-menu.js';
|
|
9
|
+
import '@brightspace-ui/core/components/dropdown/dropdown-more.js';
|
|
10
10
|
import '@brightspace-ui/core/components/list/list.js';
|
|
11
11
|
import '@brightspace-ui/core/components/list/list-item.js';
|
|
12
12
|
import '@brightspace-ui/core/components/list/list-item-content.js';
|
|
@@ -170,13 +170,9 @@ class LoadingSpinner extends LitElement {
|
|
|
170
170
|
updated(changedProperties) {
|
|
171
171
|
changedProperties.forEach((oldValue, propName) => {
|
|
172
172
|
if (propName === 'color') {
|
|
173
|
-
|
|
174
|
-
if (window.ShadyCSS) window.ShadyCSS.styleSubtree(this, { '--d2l-loading-spinner-color': this.color });
|
|
175
|
-
else this.style.setProperty('--d2l-loading-spinner-color', this.color);
|
|
173
|
+
this.style.setProperty('--d2l-loading-spinner-color', this.color);
|
|
176
174
|
} else if (propName === 'size') {
|
|
177
|
-
|
|
178
|
-
if (window.ShadyCSS) window.ShadyCSS.styleSubtree(this, { '--d2l-loading-spinner-size': `${this.size}px` });
|
|
179
|
-
else this.style.setProperty('--d2l-loading-spinner-size', `${this.size}px`);
|
|
175
|
+
this.style.setProperty('--d2l-loading-spinner-size', `${this.size}px`);
|
|
180
176
|
}
|
|
181
177
|
});
|
|
182
178
|
}
|
|
@@ -77,8 +77,7 @@ The `d2l-menu item` component is used with JS handlers and can be wired-up to th
|
|
|
77
77
|
<script type="module">
|
|
78
78
|
import '@brightspace-ui/core/components/menu/menu.js';
|
|
79
79
|
import '@brightspace-ui/core/components/menu/menu-item.js';
|
|
80
|
-
|
|
81
|
-
<script>
|
|
80
|
+
|
|
82
81
|
window.addEventListener('load', function () {
|
|
83
82
|
document.querySelector('#menu').addEventListener('d2l-menu-item-select', (e) => {
|
|
84
83
|
console.log('item selected:', e.target);
|
|
@@ -170,8 +169,7 @@ The `d2l-menu-item-checkbox` component is used for selection. It can be wired-up
|
|
|
170
169
|
<script type="module">
|
|
171
170
|
import '@brightspace-ui/core/components/menu/menu.js';
|
|
172
171
|
import '@brightspace-ui/core/components/menu/menu-item-checkbox.js';
|
|
173
|
-
|
|
174
|
-
<script>
|
|
172
|
+
|
|
175
173
|
window.addEventListener('load', function () {
|
|
176
174
|
document.querySelector('#menu-checkbox').addEventListener('d2l-menu-item-change', (e) => {
|
|
177
175
|
console.log('item selection changed:', e.target);
|
|
@@ -221,8 +219,7 @@ The `d2l-menu-item-radio` component is used for selection. It can be wired-up to
|
|
|
221
219
|
<script type="module">
|
|
222
220
|
import '@brightspace-ui/core/components/menu/menu.js';
|
|
223
221
|
import '@brightspace-ui/core/components/menu/menu-item-radio.js';
|
|
224
|
-
|
|
225
|
-
<script>
|
|
222
|
+
|
|
226
223
|
window.addEventListener('load', function () {
|
|
227
224
|
document.querySelector('#menu-radio').addEventListener('d2l-menu-item-change', (e) => {
|
|
228
225
|
console.log('item selection changed:', e.target);
|
|
@@ -4,9 +4,9 @@ Meters are a visually engaging way to communicate progress or measurements.
|
|
|
4
4
|
<!-- docs: demo -->
|
|
5
5
|
```html
|
|
6
6
|
<script type="module">
|
|
7
|
+
import '@brightspace-ui/core/components/meter/meter-circle.js';
|
|
7
8
|
import '@brightspace-ui/core/components/meter/meter-linear.js';
|
|
8
9
|
import '@brightspace-ui/core/components/meter/meter-radial.js';
|
|
9
|
-
import '@brightspace-ui/core/components/meter/meter-circle.js';
|
|
10
10
|
</script>
|
|
11
11
|
<d2l-meter-linear value="1" max="6" text="Activities"></d2l-meter-linear>
|
|
12
12
|
<d2l-meter-radial value="22" max="24" text="On Track"></d2l-meter-radial>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A switch is used to toggle between two states, on and off, just like a light switch.
|
|
4
4
|
|
|
5
|
-
<!-- docs: demo
|
|
5
|
+
<!-- docs: demo -->
|
|
6
6
|
```html
|
|
7
7
|
<script type="module">
|
|
8
8
|
import '@brightspace-ui/core/components/switch/switch.js';
|
|
@@ -36,7 +36,6 @@ The `d2l-switch` element is a generic switch with on/off semantics.
|
|
|
36
36
|
```html
|
|
37
37
|
<script type="module">
|
|
38
38
|
import '@brightspace-ui/core/components/switch/switch.js';
|
|
39
|
-
import '@brightspace-ui/core/components/switch/switch-visibility.js';
|
|
40
39
|
</script>
|
|
41
40
|
<d2l-switch text="My Switch"></d2l-switch>
|
|
42
41
|
```
|
|
@@ -77,7 +76,6 @@ The `d2l-switch-visibility` element is a variant of the generic switch configure
|
|
|
77
76
|
<script type="module">
|
|
78
77
|
import '@brightspace-ui/core/components/switch/switch-visibility.js';
|
|
79
78
|
</script>
|
|
80
|
-
|
|
81
79
|
<d2l-switch-visibility></d2l-switch-visibility>
|
|
82
80
|
```
|
|
83
81
|
|
|
@@ -11,8 +11,7 @@ Tooltips display additional information when users focus or hover on a point of
|
|
|
11
11
|
<script type="module">
|
|
12
12
|
import '@brightspace-ui/core/components/button/button.js';
|
|
13
13
|
import '@brightspace-ui/core/components/tooltip/tooltip.js';
|
|
14
|
-
|
|
15
|
-
<script>
|
|
14
|
+
|
|
16
15
|
window.addEventListener('load', function () {
|
|
17
16
|
setTimeout(function() {
|
|
18
17
|
var tooltip = document.querySelector('#tooltip');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.203.1",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"repository": "https://github.com/BrightspaceUI/core.git",
|
|
6
6
|
"publishConfig": {
|