@brightspace-ui/core 3.62.4 → 3.64.0
Sign up to get free protection for your applications and to get access to all the features.
- package/components/count-badge/README.md +31 -38
- package/components/count-badge/count-badge-mixin.js +10 -11
- package/components/dialog/dialog-mixin.js +1 -2
- package/components/filter/demo/filter-tags.html +0 -2
- package/components/filter/demo/filter.html +4 -4
- package/components/inputs/demo/input-search.html +0 -1
- package/components/inputs/input-date-time.js +3 -3
- package/components/inputs/input-date.js +1 -1
- package/components/list/list-item-generic-layout.js +0 -1
- package/custom-elements.json +40 -40
- package/helpers/focus.js +1 -1
- package/helpers/framed.js +1 -1
- package/mixins/async-container/async-container-mixin.js +1 -1
- package/mixins/loading-complete/loading-complete-mixin.js +0 -2
- package/package.json +7 -4
- package/templates/primary-secondary/primary-secondary.js +2 -2
@@ -24,30 +24,21 @@ The `d2l-count-badge` element is a web component to display a number count, depe
|
|
24
24
|
</script>
|
25
25
|
<d2l-count-badge size="small" type="notification" text="100 new notifications" number="100" has-tooltip tab-stop></d2l-count-badge>
|
26
26
|
```
|
27
|
-
|
28
|
-
### Accessibility Properties
|
29
|
-
| Attribute | Description |
|
30
|
-
|---|---|
|
31
|
-
| `text` | REQUIRED: Only the text will be read by screen-readers (not the number), so include the number in the text. |
|
32
|
-
| `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. |
|
33
|
-
| `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. |
|
34
|
-
| `has-tooltip` | The tooltip will be visible on hover/tab-stop, and read out by screen-readers. |
|
35
|
-
|
36
27
|
<!-- docs: start hidden content -->
|
37
28
|
### Properties
|
38
29
|
|
39
30
|
| Property | Type | Description |
|
40
31
|
|---|---|---|
|
41
|
-
| `number` | Number, required | The number to display on the badge
|
42
|
-
| `size
|
43
|
-
| `type
|
44
|
-
| `max-digits
|
45
|
-
| `hide-zero
|
46
|
-
| `text
|
47
|
-
| `tab-stop
|
48
|
-
| `announce-changes
|
49
|
-
| `has-tooltip
|
50
|
-
| `focus-ring
|
32
|
+
| `number` | Number, required | The number to display on the badge; must be a positive integer |
|
33
|
+
| `size` | String, default: `small` | The size of the badge. Valid options are `"small"` and `"large"`. |
|
34
|
+
| `type` | String, default: `count` | The type of the badge. Valid options are `"notification"` and `"count"`. Notification badges are orange and count badges are grey. |
|
35
|
+
| `max-digits` | Number, default: `2` when `type="notification"`, `5` when `type="count"` | Specifies a digit limit, after which numbers are truncated. Defaults to two for `"notification"` type and five for `"count"` type. Must be between 1-5.
|
36
|
+
| `hide-zero` | Boolean, default: `false` | Hides the count badge when `number` is zero |
|
37
|
+
| `text` | String, required | Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled |
|
38
|
+
| `tab-stop` | Boolean, default: `false` | Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge |
|
39
|
+
| `announce-changes` | Boolean, default: `false` | When `true`, changes to the badge will be announced to screen reader users |
|
40
|
+
| `has-tooltip` | Boolean, default: `false` | Adds a tooltip on the badge, which will be visible on hover/tab-stop, and read out by screen-readers |
|
41
|
+
| `focus-ring` | Boolean, default: `false` | Forces the focus ring around the badge. This property can be used to highlight the badge when the parent element is focused. |
|
51
42
|
<!-- docs: end hidden content -->
|
52
43
|
|
53
44
|
## Count Badge: Icon [d2l-count-badge-icon]
|
@@ -62,28 +53,30 @@ The `d2l-count-badge-icon` element is a web component to display a number count,
|
|
62
53
|
<d2l-count-badge-icon size="small" icon="tier1:gear" type="notification" text="100 new settings applied." number="100" tab-stop has-tooltip></d2l-count-badge-icon>
|
63
54
|
```
|
64
55
|
|
65
|
-
### Accessibility Properties
|
66
|
-
| Attribute | Description |
|
67
|
-
|---|---|
|
68
|
-
| `text` | REQUIRED: Only the text will be read by screen-readers (not the number), so include the number in the text. |
|
69
|
-
| `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. |
|
70
|
-
| `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. |
|
71
|
-
| `has-tooltip` | The tooltip will be visible on hover/tab-stop, and read out by screen-readers. |
|
72
|
-
|
73
56
|
<!-- docs: start hidden content -->
|
74
57
|
### Properties
|
75
58
|
|
76
59
|
| Property | Type | Description |
|
77
60
|
|--|--|--|
|
78
|
-
| `number` | Number |
|
79
|
-
| `icon` | String |
|
80
|
-
| `size
|
81
|
-
| `type
|
82
|
-
| `max-digits
|
83
|
-
| `hide-zero
|
84
|
-
| `text`
|
85
|
-
| `tab-stop
|
86
|
-
| `announce-changes
|
87
|
-
| `has-tooltip
|
88
|
-
| `focus-ring
|
61
|
+
| `number` | Number, required | The number to display on the badge; must be a positive integer |
|
62
|
+
| `icon` | String, required | [Preset icon key](../icons#preset-icons) (e.g. `tier1:gear`) |
|
63
|
+
| `size` | String, default: `small` | The size of the badge. Valid options are `"small"` and `"large"`. |
|
64
|
+
| `type` | String, default: `count` | The type of the badge. Valid options are `"notification"` and `"count"`. Notification badges are orange and count badges are grey. |
|
65
|
+
| `max-digits` | Number, default: `2` when `type="notification"`, `5` when `type="count"` | Specifies a digit limit, after which numbers are truncated. Defaults to two for `"notification"` type and five for `"count"` type. Must be between 1-5.
|
66
|
+
| `hide-zero` | Boolean, default: `false` | Hides the count badge when `number` is zero |
|
67
|
+
| `text` | String, required | Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled |
|
68
|
+
| `tab-stop` | Boolean, default: `false` | Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge |
|
69
|
+
| `announce-changes` | Boolean, default: `false` | When `true`, changes to the badge will be announced to screen reader users |
|
70
|
+
| `has-tooltip` | Boolean, default: `false` | Adds a tooltip on the badge, which will be visible on hover/tab-stop, and read out by screen-readers |
|
71
|
+
| `focus-ring` | Boolean, default: `false` | Forces a focus ring around the badge. This property can be used to highlight the badge when the parent element is focused. |
|
89
72
|
<!-- docs: end hidden content -->
|
73
|
+
|
74
|
+
## Accessibility
|
75
|
+
|
76
|
+
Notable accessibility features:
|
77
|
+
- `tab-stop`:
|
78
|
+
- While non-interactive components traditionally shouldn't be focusable, this property greatly helps screen reader users find the the count badge, and removes the need to use the arrow keys to navigate to it
|
79
|
+
- This isn't needed if the optional tooltip is used, as the count-badge becomes focusable in order to display the tooltip
|
80
|
+
- `has-tooltip`:
|
81
|
+
- The optional tooltip makes use of the [`d2l-tooltip`](../../components/tooltip), which follows the [W3C best practices for Tooltips](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/)
|
82
|
+
- This tooltip can help provide additional context, such as by providing the exact count badge number if it were to go above the limit set in `max-digits`
|
@@ -16,7 +16,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
16
16
|
static get properties() {
|
17
17
|
return {
|
18
18
|
/**
|
19
|
-
*
|
19
|
+
* ACCESSIBILITY: When `true`, changes to the badge will be announced to screen reader users
|
20
20
|
* @type {boolean}
|
21
21
|
*/
|
22
22
|
announceChanges: {
|
@@ -24,7 +24,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
24
24
|
attribute: 'announce-changes'
|
25
25
|
},
|
26
26
|
/**
|
27
|
-
*
|
27
|
+
* Forces the focus ring around the badge
|
28
28
|
* @type {boolean}
|
29
29
|
*/
|
30
30
|
forceFocusRing: {
|
@@ -33,7 +33,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
33
33
|
reflect: true
|
34
34
|
},
|
35
35
|
/**
|
36
|
-
*
|
36
|
+
* ACCESSIBILITY: Adds a tooltip on the badge, which will be visible on hover and keyboard interaction
|
37
37
|
* @type {boolean}
|
38
38
|
*/
|
39
39
|
hasTooltip: {
|
@@ -41,7 +41,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
41
41
|
attribute: 'has-tooltip'
|
42
42
|
},
|
43
43
|
/**
|
44
|
-
*
|
44
|
+
* Hides the count badge when `number` is zero
|
45
45
|
* @type {boolean}
|
46
46
|
*/
|
47
47
|
hideZero: {
|
@@ -49,8 +49,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
49
49
|
attribute: 'hide-zero'
|
50
50
|
},
|
51
51
|
/**
|
52
|
-
*
|
53
|
-
* Defaults to two for "notification" type and five for "count" type.
|
52
|
+
* Specifies a digit limit, after which numbers are truncated. Defaults to two for "notification" type and five for "count" type.
|
54
53
|
* @type {number}
|
55
54
|
*/
|
56
55
|
maxDigits: {
|
@@ -58,7 +57,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
58
57
|
attribute: 'max-digits'
|
59
58
|
},
|
60
59
|
/**
|
61
|
-
* REQUIRED: The number to be displayed on the badge
|
60
|
+
* REQUIRED: The number to be displayed on the badge; must be a positive integer
|
62
61
|
* @type {number}
|
63
62
|
*/
|
64
63
|
number: {
|
@@ -66,7 +65,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
66
65
|
attribute: 'number'
|
67
66
|
},
|
68
67
|
/**
|
69
|
-
* The size of the badge
|
68
|
+
* The size of the badge
|
70
69
|
* @type {'small'|'large'}
|
71
70
|
*/
|
72
71
|
size: {
|
@@ -75,7 +74,7 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
75
74
|
attribute: 'size'
|
76
75
|
},
|
77
76
|
/**
|
78
|
-
*
|
77
|
+
* ACCESSIBILITY: Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge
|
79
78
|
* @type {boolean}
|
80
79
|
*/
|
81
80
|
tabStop: {
|
@@ -83,14 +82,14 @@ export const CountBadgeMixin = superclass => class extends LocalizeCoreElement(S
|
|
83
82
|
attribute: 'tab-stop'
|
84
83
|
},
|
85
84
|
/**
|
86
|
-
* REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled
|
85
|
+
* ACCESSIBILITY: REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled
|
87
86
|
* @type {string}
|
88
87
|
*/
|
89
88
|
text: {
|
90
89
|
type: String
|
91
90
|
},
|
92
91
|
/**
|
93
|
-
* The type of the badge
|
92
|
+
* The type of the badge
|
94
93
|
* @type {'count'|'notification'}
|
95
94
|
*/
|
96
95
|
type: {
|
@@ -19,8 +19,7 @@ window.D2L.DialogMixin = window.D2L.DialogMixin || {};
|
|
19
19
|
// https://bugs.webkit.org/show_bug.cgi?id=233320
|
20
20
|
// starting in Chrome 102, all elements inside <dialog>s that are inside shadow roots have null offsetParent
|
21
21
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1331803
|
22
|
-
window.D2L.DialogMixin.hasNative = false
|
23
|
-
&& (navigator.vendor && navigator.vendor.toLowerCase().indexOf('apple') === -1);
|
22
|
+
window.D2L.DialogMixin.hasNative = false;
|
24
23
|
if (window.D2L.DialogMixin.preferNative === undefined) {
|
25
24
|
window.D2L.DialogMixin.preferNative = true;
|
26
25
|
}
|
@@ -77,14 +77,12 @@
|
|
77
77
|
coreFilter.addEventListener('d2l-filter-change', (e) => {
|
78
78
|
logEvent(e, 'Filter value(s) changed!');
|
79
79
|
});
|
80
|
-
/* eslint-disable no-console */
|
81
80
|
function logEvent(e, text) {
|
82
81
|
console.group(text);
|
83
82
|
console.log('event', e);
|
84
83
|
if (e.detail) console.log('detail', e.detail);
|
85
84
|
console.groupEnd();
|
86
85
|
}
|
87
|
-
/* eslint-enable no-console */
|
88
86
|
</script>
|
89
87
|
|
90
88
|
<h2>Registered to both filters</h2>
|
@@ -191,14 +191,14 @@
|
|
191
191
|
<script type="module">
|
192
192
|
document.addEventListener('d2l-filter-change', e => {
|
193
193
|
if (e.detail.dimensions.length === 1) {
|
194
|
-
console.log(`Filter selection(s) changed for dimension "${e.detail.dimensions[0].dimensionKey}":`, e.detail.dimensions[0].changes);
|
195
|
-
if (e.detail.dimensions[0].cleared) console.log(`(Dimension "${e.detail.dimensions[0].dimensionKey}" cleared)`);
|
194
|
+
console.log(`Filter selection(s) changed for dimension "${e.detail.dimensions[0].dimensionKey}":`, e.detail.dimensions[0].changes);
|
195
|
+
if (e.detail.dimensions[0].cleared) console.log(`(Dimension "${e.detail.dimensions[0].dimensionKey}" cleared)`);
|
196
196
|
} else {
|
197
|
-
console.log('Multiple dimension selections changed:', e.detail.dimensions);
|
197
|
+
console.log('Multiple dimension selections changed:', e.detail.dimensions);
|
198
198
|
}
|
199
199
|
|
200
200
|
if (e.detail.allCleared) {
|
201
|
-
console.log('(All dimensions cleared)');
|
201
|
+
console.log('(All dimensions cleared)');
|
202
202
|
}
|
203
203
|
});
|
204
204
|
|
@@ -143,7 +143,7 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
|
|
143
143
|
const dateObj = parseISODateTime(val);
|
144
144
|
const localDateTime = convertUTCToLocalDateTime(dateObj);
|
145
145
|
this._maxValueLocalized = formatDateInISO(localDateTime);
|
146
|
-
} catch
|
146
|
+
} catch {
|
147
147
|
this._maxValueLocalized = undefined;
|
148
148
|
}
|
149
149
|
}
|
@@ -160,7 +160,7 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
|
|
160
160
|
const dateObj = parseISODateTime(val);
|
161
161
|
const localDateTime = convertUTCToLocalDateTime(dateObj);
|
162
162
|
this._minValueLocalized = formatDateInISO(localDateTime);
|
163
|
-
} catch
|
163
|
+
} catch {
|
164
164
|
this._minValueLocalized = undefined;
|
165
165
|
}
|
166
166
|
}
|
@@ -176,7 +176,7 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
|
|
176
176
|
try {
|
177
177
|
getLocalDateTimeFromUTCDateTime(val);
|
178
178
|
this._value = val;
|
179
|
-
} catch
|
179
|
+
} catch {
|
180
180
|
this._value = '';
|
181
181
|
}
|
182
182
|
}
|
@@ -371,7 +371,7 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
|
|
371
371
|
try {
|
372
372
|
const date = parseDate(value);
|
373
373
|
await this._updateValueDispatchEvent(formatDateInISO({ year: date.getFullYear(), month: (parseInt(date.getMonth()) + 1), date: date.getDate() }));
|
374
|
-
} catch
|
374
|
+
} catch {
|
375
375
|
// leave value the same when invalid input
|
376
376
|
}
|
377
377
|
this._setFormattedValue(); // keep out here in case parseDate is same date, e.g., user adds invalid text to end of parseable date
|
@@ -205,7 +205,6 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
205
205
|
const slot = (event.path || event.composedPath()).find((node) =>
|
206
206
|
node.nodeName === 'SLOT' && ['content'].includes(node.name)
|
207
207
|
);
|
208
|
-
// eslint-disable-next-line no-console
|
209
208
|
console.warn(`${slot.name} area should not have focusable items in it. Consider using href or creating a custom list-item.`);
|
210
209
|
},
|
211
210
|
capture: true
|
package/custom-elements.json
CHANGED
@@ -1516,59 +1516,59 @@
|
|
1516
1516
|
},
|
1517
1517
|
{
|
1518
1518
|
"name": "max-digits",
|
1519
|
-
"description": "
|
1519
|
+
"description": "Specifies a digit limit, after which numbers are truncated. Defaults to two for \"notification\" type and five for \"count\" type.",
|
1520
1520
|
"type": "number"
|
1521
1521
|
},
|
1522
1522
|
{
|
1523
1523
|
"name": "number",
|
1524
|
-
"description": "REQUIRED: The number to be displayed on the badge
|
1524
|
+
"description": "REQUIRED: The number to be displayed on the badge; must be a positive integer",
|
1525
1525
|
"type": "number"
|
1526
1526
|
},
|
1527
1527
|
{
|
1528
1528
|
"name": "announce-changes",
|
1529
|
-
"description": "
|
1529
|
+
"description": "ACCESSIBILITY: When `true`, changes to the badge will be announced to screen reader users",
|
1530
1530
|
"type": "boolean",
|
1531
1531
|
"default": "false"
|
1532
1532
|
},
|
1533
1533
|
{
|
1534
1534
|
"name": "focus-ring",
|
1535
|
-
"description": "
|
1535
|
+
"description": "Forces the focus ring around the badge",
|
1536
1536
|
"type": "boolean",
|
1537
1537
|
"default": "false"
|
1538
1538
|
},
|
1539
1539
|
{
|
1540
1540
|
"name": "has-tooltip",
|
1541
|
-
"description": "
|
1541
|
+
"description": "ACCESSIBILITY: Adds a tooltip on the badge, which will be visible on hover and keyboard interaction",
|
1542
1542
|
"type": "boolean",
|
1543
1543
|
"default": "false"
|
1544
1544
|
},
|
1545
1545
|
{
|
1546
1546
|
"name": "hide-zero",
|
1547
|
-
"description": "
|
1547
|
+
"description": "Hides the count badge when `number` is zero",
|
1548
1548
|
"type": "boolean",
|
1549
1549
|
"default": "false"
|
1550
1550
|
},
|
1551
1551
|
{
|
1552
1552
|
"name": "size",
|
1553
|
-
"description": "The size of the badge
|
1553
|
+
"description": "The size of the badge",
|
1554
1554
|
"type": "'small'|'large'",
|
1555
1555
|
"default": "\"small\""
|
1556
1556
|
},
|
1557
1557
|
{
|
1558
1558
|
"name": "tab-stop",
|
1559
|
-
"description": "
|
1559
|
+
"description": "ACCESSIBILITY: Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge",
|
1560
1560
|
"type": "boolean",
|
1561
1561
|
"default": "false"
|
1562
1562
|
},
|
1563
1563
|
{
|
1564
1564
|
"name": "text",
|
1565
|
-
"description": "REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled
|
1565
|
+
"description": "ACCESSIBILITY: REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled",
|
1566
1566
|
"type": "string",
|
1567
1567
|
"default": "\"\""
|
1568
1568
|
},
|
1569
1569
|
{
|
1570
1570
|
"name": "type",
|
1571
|
-
"description": "The type of the badge
|
1571
|
+
"description": "The type of the badge",
|
1572
1572
|
"type": "'count'|'notification'",
|
1573
1573
|
"default": "\"count\""
|
1574
1574
|
},
|
@@ -1588,68 +1588,68 @@
|
|
1588
1588
|
{
|
1589
1589
|
"name": "maxDigits",
|
1590
1590
|
"attribute": "max-digits",
|
1591
|
-
"description": "
|
1591
|
+
"description": "Specifies a digit limit, after which numbers are truncated. Defaults to two for \"notification\" type and five for \"count\" type.",
|
1592
1592
|
"type": "number"
|
1593
1593
|
},
|
1594
1594
|
{
|
1595
1595
|
"name": "number",
|
1596
1596
|
"attribute": "number",
|
1597
|
-
"description": "REQUIRED: The number to be displayed on the badge
|
1597
|
+
"description": "REQUIRED: The number to be displayed on the badge; must be a positive integer",
|
1598
1598
|
"type": "number"
|
1599
1599
|
},
|
1600
1600
|
{
|
1601
1601
|
"name": "announceChanges",
|
1602
1602
|
"attribute": "announce-changes",
|
1603
|
-
"description": "
|
1603
|
+
"description": "ACCESSIBILITY: When `true`, changes to the badge will be announced to screen reader users",
|
1604
1604
|
"type": "boolean",
|
1605
1605
|
"default": "false"
|
1606
1606
|
},
|
1607
1607
|
{
|
1608
1608
|
"name": "forceFocusRing",
|
1609
1609
|
"attribute": "focus-ring",
|
1610
|
-
"description": "
|
1610
|
+
"description": "Forces the focus ring around the badge",
|
1611
1611
|
"type": "boolean",
|
1612
1612
|
"default": "false"
|
1613
1613
|
},
|
1614
1614
|
{
|
1615
1615
|
"name": "hasTooltip",
|
1616
1616
|
"attribute": "has-tooltip",
|
1617
|
-
"description": "
|
1617
|
+
"description": "ACCESSIBILITY: Adds a tooltip on the badge, which will be visible on hover and keyboard interaction",
|
1618
1618
|
"type": "boolean",
|
1619
1619
|
"default": "false"
|
1620
1620
|
},
|
1621
1621
|
{
|
1622
1622
|
"name": "hideZero",
|
1623
1623
|
"attribute": "hide-zero",
|
1624
|
-
"description": "
|
1624
|
+
"description": "Hides the count badge when `number` is zero",
|
1625
1625
|
"type": "boolean",
|
1626
1626
|
"default": "false"
|
1627
1627
|
},
|
1628
1628
|
{
|
1629
1629
|
"name": "size",
|
1630
1630
|
"attribute": "size",
|
1631
|
-
"description": "The size of the badge
|
1631
|
+
"description": "The size of the badge",
|
1632
1632
|
"type": "'small'|'large'",
|
1633
1633
|
"default": "\"small\""
|
1634
1634
|
},
|
1635
1635
|
{
|
1636
1636
|
"name": "tabStop",
|
1637
1637
|
"attribute": "tab-stop",
|
1638
|
-
"description": "
|
1638
|
+
"description": "ACCESSIBILITY: Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge",
|
1639
1639
|
"type": "boolean",
|
1640
1640
|
"default": "false"
|
1641
1641
|
},
|
1642
1642
|
{
|
1643
1643
|
"name": "text",
|
1644
1644
|
"attribute": "text",
|
1645
|
-
"description": "REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled
|
1645
|
+
"description": "ACCESSIBILITY: REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled",
|
1646
1646
|
"type": "string",
|
1647
1647
|
"default": "\"\""
|
1648
1648
|
},
|
1649
1649
|
{
|
1650
1650
|
"name": "type",
|
1651
1651
|
"attribute": "type",
|
1652
|
-
"description": "The type of the badge
|
1652
|
+
"description": "The type of the badge",
|
1653
1653
|
"type": "'count'|'notification'",
|
1654
1654
|
"default": "\"count\""
|
1655
1655
|
},
|
@@ -1667,59 +1667,59 @@
|
|
1667
1667
|
"attributes": [
|
1668
1668
|
{
|
1669
1669
|
"name": "max-digits",
|
1670
|
-
"description": "
|
1670
|
+
"description": "Specifies a digit limit, after which numbers are truncated. Defaults to two for \"notification\" type and five for \"count\" type.",
|
1671
1671
|
"type": "number"
|
1672
1672
|
},
|
1673
1673
|
{
|
1674
1674
|
"name": "number",
|
1675
|
-
"description": "REQUIRED: The number to be displayed on the badge
|
1675
|
+
"description": "REQUIRED: The number to be displayed on the badge; must be a positive integer",
|
1676
1676
|
"type": "number"
|
1677
1677
|
},
|
1678
1678
|
{
|
1679
1679
|
"name": "announce-changes",
|
1680
|
-
"description": "
|
1680
|
+
"description": "ACCESSIBILITY: When `true`, changes to the badge will be announced to screen reader users",
|
1681
1681
|
"type": "boolean",
|
1682
1682
|
"default": "false"
|
1683
1683
|
},
|
1684
1684
|
{
|
1685
1685
|
"name": "focus-ring",
|
1686
|
-
"description": "
|
1686
|
+
"description": "Forces the focus ring around the badge",
|
1687
1687
|
"type": "boolean",
|
1688
1688
|
"default": "false"
|
1689
1689
|
},
|
1690
1690
|
{
|
1691
1691
|
"name": "has-tooltip",
|
1692
|
-
"description": "
|
1692
|
+
"description": "ACCESSIBILITY: Adds a tooltip on the badge, which will be visible on hover and keyboard interaction",
|
1693
1693
|
"type": "boolean",
|
1694
1694
|
"default": "false"
|
1695
1695
|
},
|
1696
1696
|
{
|
1697
1697
|
"name": "hide-zero",
|
1698
|
-
"description": "
|
1698
|
+
"description": "Hides the count badge when `number` is zero",
|
1699
1699
|
"type": "boolean",
|
1700
1700
|
"default": "false"
|
1701
1701
|
},
|
1702
1702
|
{
|
1703
1703
|
"name": "size",
|
1704
|
-
"description": "The size of the badge
|
1704
|
+
"description": "The size of the badge",
|
1705
1705
|
"type": "'small'|'large'",
|
1706
1706
|
"default": "\"small\""
|
1707
1707
|
},
|
1708
1708
|
{
|
1709
1709
|
"name": "tab-stop",
|
1710
|
-
"description": "
|
1710
|
+
"description": "ACCESSIBILITY: Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge",
|
1711
1711
|
"type": "boolean",
|
1712
1712
|
"default": "false"
|
1713
1713
|
},
|
1714
1714
|
{
|
1715
1715
|
"name": "text",
|
1716
|
-
"description": "REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled
|
1716
|
+
"description": "ACCESSIBILITY: REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled",
|
1717
1717
|
"type": "string",
|
1718
1718
|
"default": "\"\""
|
1719
1719
|
},
|
1720
1720
|
{
|
1721
1721
|
"name": "type",
|
1722
|
-
"description": "The type of the badge
|
1722
|
+
"description": "The type of the badge",
|
1723
1723
|
"type": "'count'|'notification'",
|
1724
1724
|
"default": "\"count\""
|
1725
1725
|
},
|
@@ -1733,68 +1733,68 @@
|
|
1733
1733
|
{
|
1734
1734
|
"name": "maxDigits",
|
1735
1735
|
"attribute": "max-digits",
|
1736
|
-
"description": "
|
1736
|
+
"description": "Specifies a digit limit, after which numbers are truncated. Defaults to two for \"notification\" type and five for \"count\" type.",
|
1737
1737
|
"type": "number"
|
1738
1738
|
},
|
1739
1739
|
{
|
1740
1740
|
"name": "number",
|
1741
1741
|
"attribute": "number",
|
1742
|
-
"description": "REQUIRED: The number to be displayed on the badge
|
1742
|
+
"description": "REQUIRED: The number to be displayed on the badge; must be a positive integer",
|
1743
1743
|
"type": "number"
|
1744
1744
|
},
|
1745
1745
|
{
|
1746
1746
|
"name": "announceChanges",
|
1747
1747
|
"attribute": "announce-changes",
|
1748
|
-
"description": "
|
1748
|
+
"description": "ACCESSIBILITY: When `true`, changes to the badge will be announced to screen reader users",
|
1749
1749
|
"type": "boolean",
|
1750
1750
|
"default": "false"
|
1751
1751
|
},
|
1752
1752
|
{
|
1753
1753
|
"name": "forceFocusRing",
|
1754
1754
|
"attribute": "focus-ring",
|
1755
|
-
"description": "
|
1755
|
+
"description": "Forces the focus ring around the badge",
|
1756
1756
|
"type": "boolean",
|
1757
1757
|
"default": "false"
|
1758
1758
|
},
|
1759
1759
|
{
|
1760
1760
|
"name": "hasTooltip",
|
1761
1761
|
"attribute": "has-tooltip",
|
1762
|
-
"description": "
|
1762
|
+
"description": "ACCESSIBILITY: Adds a tooltip on the badge, which will be visible on hover and keyboard interaction",
|
1763
1763
|
"type": "boolean",
|
1764
1764
|
"default": "false"
|
1765
1765
|
},
|
1766
1766
|
{
|
1767
1767
|
"name": "hideZero",
|
1768
1768
|
"attribute": "hide-zero",
|
1769
|
-
"description": "
|
1769
|
+
"description": "Hides the count badge when `number` is zero",
|
1770
1770
|
"type": "boolean",
|
1771
1771
|
"default": "false"
|
1772
1772
|
},
|
1773
1773
|
{
|
1774
1774
|
"name": "size",
|
1775
1775
|
"attribute": "size",
|
1776
|
-
"description": "The size of the badge
|
1776
|
+
"description": "The size of the badge",
|
1777
1777
|
"type": "'small'|'large'",
|
1778
1778
|
"default": "\"small\""
|
1779
1779
|
},
|
1780
1780
|
{
|
1781
1781
|
"name": "tabStop",
|
1782
1782
|
"attribute": "tab-stop",
|
1783
|
-
"description": "
|
1783
|
+
"description": "ACCESSIBILITY: Adds a tab stop to the badge, which allows screen reader and keyboard users to easily tab to the badge",
|
1784
1784
|
"type": "boolean",
|
1785
1785
|
"default": "false"
|
1786
1786
|
},
|
1787
1787
|
{
|
1788
1788
|
"name": "text",
|
1789
1789
|
"attribute": "text",
|
1790
|
-
"description": "REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled
|
1790
|
+
"description": "ACCESSIBILITY: REQUIRED: Descriptive text for the badge which will act as an accessible label and tooltip text when tooltips are enabled",
|
1791
1791
|
"type": "string",
|
1792
1792
|
"default": "\"\""
|
1793
1793
|
},
|
1794
1794
|
{
|
1795
1795
|
"name": "type",
|
1796
1796
|
"attribute": "type",
|
1797
|
-
"description": "The type of the badge
|
1797
|
+
"description": "The type of the badge",
|
1798
1798
|
"type": "'count'|'notification'",
|
1799
1799
|
"default": "\"count\""
|
1800
1800
|
},
|
package/helpers/focus.js
CHANGED
@@ -202,7 +202,7 @@ export function isFocusVisibleSupported() {
|
|
202
202
|
document.head.appendChild(style);
|
203
203
|
style.sheet.insertRule(':focus-visible { color: inherit; }');
|
204
204
|
_isFocusVisibleSupported = true;
|
205
|
-
} catch
|
205
|
+
} catch {
|
206
206
|
_isFocusVisibleSupported = false;
|
207
207
|
} finally {
|
208
208
|
style.remove();
|
package/helpers/framed.js
CHANGED
@@ -59,7 +59,7 @@ export const AsyncContainerMixin = superclass => class extends superclass {
|
|
59
59
|
try {
|
60
60
|
await promise;
|
61
61
|
if (this._asyncPromises.indexOf(promise) !== -1) this._asyncCounts.fulfilled++;
|
62
|
-
} catch
|
62
|
+
} catch {
|
63
63
|
if (this._asyncPromises.indexOf(promise) !== -1) this._asyncCounts.rejected++;
|
64
64
|
} finally {
|
65
65
|
if (this._asyncPromises.indexOf(promise) !== -1) {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
2
2
|
|
3
3
|
export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends superclass {
|
4
|
-
|
5
4
|
get loadingComplete() {
|
6
5
|
return this.getLoadingComplete();
|
7
6
|
}
|
@@ -22,7 +21,6 @@ export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends su
|
|
22
21
|
|
23
22
|
#loadingCompleteResolve;
|
24
23
|
|
25
|
-
// eslint-disable-next-line sort-class-members/sort-class-members
|
26
24
|
#loadingCompletePromise = !Object.prototype.hasOwnProperty.call(this.constructor.prototype, 'getLoadingComplete')
|
27
25
|
? new Promise(resolve => this.#loadingCompleteResolve = resolve)
|
28
26
|
: Promise.resolve();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.64.0",
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
5
5
|
"type": "module",
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"build": "npm run build:clean && npm run build:icons && npm run build:illustrations && npm run build:sass && npm run build:wca",
|
17
17
|
"build-static": "rollup -c ./rollup/rollup.config.js",
|
18
18
|
"lint": "npm run lint:eslint && npm run lint:style",
|
19
|
-
"lint:eslint": "eslint .
|
19
|
+
"lint:eslint": "eslint .",
|
20
20
|
"lint:style": "stylelint \"**/*.{js,html}\" --ignore-path .gitignore",
|
21
21
|
"start": "web-dev-server --node-resolve --watch --open",
|
22
22
|
"test": "npm run lint && npm run test:translations && npm run test:unit && npm run test:axe",
|
@@ -47,13 +47,16 @@
|
|
47
47
|
"devDependencies": {
|
48
48
|
"@brightspace-ui/stylelint-config": "^1",
|
49
49
|
"@brightspace-ui/testing": "^1",
|
50
|
+
"@eslint/compat": "^1",
|
51
|
+
"@eslint/eslintrc": "^3",
|
52
|
+
"@eslint/js": "^9",
|
50
53
|
"@rollup/plugin-dynamic-import-vars": "^2",
|
51
54
|
"@rollup/plugin-node-resolve": "^15",
|
52
55
|
"@rollup/plugin-replace": "^6",
|
53
56
|
"@web/dev-server": "^0.4",
|
54
57
|
"chalk": "^5",
|
55
|
-
"eslint": "^
|
56
|
-
"eslint-config-brightspace": "^1",
|
58
|
+
"eslint": "^9",
|
59
|
+
"eslint-config-brightspace": "^1.2.1",
|
57
60
|
"glob-all": "^3",
|
58
61
|
"messageformat-validator": "^2",
|
59
62
|
"node-sass": "^9",
|
@@ -1066,7 +1066,7 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
1066
1066
|
const key = computeSizeKey(this.storageKey);
|
1067
1067
|
try {
|
1068
1068
|
localStorage.setItem(key, this._size);
|
1069
|
-
} catch
|
1069
|
+
} catch {
|
1070
1070
|
// throws if storage is full or in private mode in mobile Safari
|
1071
1071
|
}
|
1072
1072
|
}
|
@@ -1146,7 +1146,7 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
1146
1146
|
const key = computeSizeKey(this.storageKey);
|
1147
1147
|
try {
|
1148
1148
|
size = parseFloat(localStorage.getItem(key));
|
1149
|
-
} catch
|
1149
|
+
} catch {
|
1150
1150
|
// may throw SecurityError if localStorage isn't allowed to be accessed
|
1151
1151
|
}
|
1152
1152
|
}
|