@brightspace-ui/core 2.47.4 → 2.48.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/components/description-list/README.md +1 -1
- package/components/selection/selection-mixin.js +6 -1
- package/components/selection/selection-summary.js +13 -5
- package/custom-elements.json +33 -0
- package/helpers/README.md +1 -1
- package/helpers/focus.js +3 -3
- package/helpers/prism.js +6 -3
- package/lang/ar.js +1 -1
- package/lang/da.js +1 -1
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ A Description List displays static pairs of terms and definitions in a vertical
|
|
|
28
28
|
<!-- docs: end best practices -->
|
|
29
29
|
|
|
30
30
|
## Responsive Behavior
|
|
31
|
-
|
|
31
|
+
For very long values, or very small container sizes, the description list can use a vertically stacked layout. By default this happens at a container-width breakpoint of `240px`, but the `breakpoint` property provides flexibility so it can be adjusted to suit your content.
|
|
32
32
|
|
|
33
33
|
<!-- docs: demo -->
|
|
34
34
|
```html
|
|
@@ -48,7 +48,12 @@ export const SelectionMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
48
48
|
* Whether to render with single selection behaviour. If `selection-single` is specified, the nested `d2l-selection-input` elements will render radios instead of checkboxes, and the selection component will maintain a single selected item.
|
|
49
49
|
* @type {boolean}
|
|
50
50
|
*/
|
|
51
|
-
selectionSingle: { type: Boolean, attribute: 'selection-single' }
|
|
51
|
+
selectionSingle: { type: Boolean, attribute: 'selection-single' },
|
|
52
|
+
/**
|
|
53
|
+
* Number of selected items. Optional parameter used to override existing count.
|
|
54
|
+
* @type {number}
|
|
55
|
+
*/
|
|
56
|
+
selectionCountOverride: { type: Number, attribute: 'selection-count-override' }
|
|
52
57
|
};
|
|
53
58
|
}
|
|
54
59
|
|
|
@@ -37,11 +37,19 @@ class Summary extends LocalizeCoreElement(SelectionObserverMixin(LitElement)) {
|
|
|
37
37
|
render() {
|
|
38
38
|
if (this._provider && this._provider.selectionSingle) return;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.
|
|
40
|
+
let count;
|
|
41
|
+
let summary;
|
|
42
|
+
if (this._provider && this._provider.selectionCountOverride !== undefined) {
|
|
43
|
+
count = this._provider.selectionCountOverride;
|
|
44
|
+
summary = (this._provider.selectionCountOverride === 0 && this.noSelectionText ?
|
|
45
|
+
this.noSelectionText : this.localize('components.selection.selected', 'count', count));
|
|
46
|
+
} else {
|
|
47
|
+
count = (this.selectionInfo.state === SelectionInfo.states.allPages ?
|
|
48
|
+
this._provider.itemCount : this.selectionInfo.keys.length);
|
|
49
|
+
|
|
50
|
+
summary = (this.selectionInfo.state === SelectionInfo.states.none && this.noSelectionText ?
|
|
51
|
+
this.noSelectionText : this.localize('components.selection.selected', 'count', count));
|
|
52
|
+
}
|
|
45
53
|
|
|
46
54
|
return html`
|
|
47
55
|
<p class="d2l-body-compact">${summary}</p>
|
package/custom-elements.json
CHANGED
|
@@ -7880,6 +7880,11 @@
|
|
|
7880
7880
|
"type": "boolean",
|
|
7881
7881
|
"default": "false"
|
|
7882
7882
|
},
|
|
7883
|
+
{
|
|
7884
|
+
"name": "selection-count-override",
|
|
7885
|
+
"description": "Number of selected items. Optional parameter used to override existing count.",
|
|
7886
|
+
"type": "number"
|
|
7887
|
+
},
|
|
7883
7888
|
{
|
|
7884
7889
|
"name": "item-count",
|
|
7885
7890
|
"description": "Total number of items. Required when selecting all pages is allowed.",
|
|
@@ -7922,6 +7927,12 @@
|
|
|
7922
7927
|
"type": "boolean",
|
|
7923
7928
|
"default": "false"
|
|
7924
7929
|
},
|
|
7930
|
+
{
|
|
7931
|
+
"name": "selectionCountOverride",
|
|
7932
|
+
"attribute": "selection-count-override",
|
|
7933
|
+
"description": "Number of selected items. Optional parameter used to override existing count.",
|
|
7934
|
+
"type": "number"
|
|
7935
|
+
},
|
|
7925
7936
|
{
|
|
7926
7937
|
"name": "itemCount",
|
|
7927
7938
|
"attribute": "item-count",
|
|
@@ -9093,6 +9104,11 @@
|
|
|
9093
9104
|
"name": "d2l-demo-selection",
|
|
9094
9105
|
"path": "./components/selection/demo/demo-selection.js",
|
|
9095
9106
|
"attributes": [
|
|
9107
|
+
{
|
|
9108
|
+
"name": "selection-count-override",
|
|
9109
|
+
"description": "Number of selected items. Optional parameter used to override existing count.",
|
|
9110
|
+
"type": "number"
|
|
9111
|
+
},
|
|
9096
9112
|
{
|
|
9097
9113
|
"name": "item-count",
|
|
9098
9114
|
"description": "Total number of items. Required when selecting all pages is allowed.",
|
|
@@ -9107,6 +9123,12 @@
|
|
|
9107
9123
|
}
|
|
9108
9124
|
],
|
|
9109
9125
|
"properties": [
|
|
9126
|
+
{
|
|
9127
|
+
"name": "selectionCountOverride",
|
|
9128
|
+
"attribute": "selection-count-override",
|
|
9129
|
+
"description": "Number of selected items. Optional parameter used to override existing count.",
|
|
9130
|
+
"type": "number"
|
|
9131
|
+
},
|
|
9110
9132
|
{
|
|
9111
9133
|
"name": "itemCount",
|
|
9112
9134
|
"attribute": "item-count",
|
|
@@ -9634,6 +9656,11 @@
|
|
|
9634
9656
|
"name": "d2l-test-selection",
|
|
9635
9657
|
"path": "./components/selection/test/selection-component.js",
|
|
9636
9658
|
"attributes": [
|
|
9659
|
+
{
|
|
9660
|
+
"name": "selection-count-override",
|
|
9661
|
+
"description": "Number of selected items. Optional parameter used to override existing count.",
|
|
9662
|
+
"type": "number"
|
|
9663
|
+
},
|
|
9637
9664
|
{
|
|
9638
9665
|
"name": "item-count",
|
|
9639
9666
|
"description": "Total number of items. Required when selecting all pages is allowed.",
|
|
@@ -9648,6 +9675,12 @@
|
|
|
9648
9675
|
}
|
|
9649
9676
|
],
|
|
9650
9677
|
"properties": [
|
|
9678
|
+
{
|
|
9679
|
+
"name": "selectionCountOverride",
|
|
9680
|
+
"attribute": "selection-count-override",
|
|
9681
|
+
"description": "Number of selected items. Optional parameter used to override existing count.",
|
|
9682
|
+
"type": "number"
|
|
9683
|
+
},
|
|
9651
9684
|
{
|
|
9652
9685
|
"name": "itemCount",
|
|
9653
9686
|
"attribute": "item-count",
|
package/helpers/README.md
CHANGED
|
@@ -127,7 +127,7 @@ forceFocusVisible(node);
|
|
|
127
127
|
getComposedActiveElement()
|
|
128
128
|
|
|
129
129
|
// gets the first focusable descendant given a node, including those within the shadow DOM
|
|
130
|
-
getFirstFocusableDescendant(node, includeHidden, predicate)
|
|
130
|
+
getFirstFocusableDescendant(node, includeHidden, predicate, includeTabbablesOnly)
|
|
131
131
|
|
|
132
132
|
// gets the last focusable descendant given a node, including those within the shadow DOM
|
|
133
133
|
getLastFocusableDescendant(node, includeHidden)
|
package/helpers/focus.js
CHANGED
|
@@ -37,15 +37,15 @@ export function getComposedActiveElement() {
|
|
|
37
37
|
return node;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export function getFirstFocusableDescendant(node, includeHidden, predicate) {
|
|
40
|
+
export function getFirstFocusableDescendant(node, includeHidden, predicate, includeTabbablesOnly) {
|
|
41
41
|
if (predicate === undefined) predicate = () => true;
|
|
42
42
|
|
|
43
43
|
const composedChildren = getComposedChildren(node);
|
|
44
44
|
|
|
45
45
|
for (let i = 0; i < composedChildren.length; i++) {
|
|
46
|
-
if (isFocusable(composedChildren[i], includeHidden) && predicate(composedChildren[i])) return composedChildren[i];
|
|
46
|
+
if (isFocusable(composedChildren[i], includeHidden, includeTabbablesOnly) && predicate(composedChildren[i])) return composedChildren[i];
|
|
47
47
|
|
|
48
|
-
const focusable = getFirstFocusableDescendant(composedChildren[i], includeHidden, predicate);
|
|
48
|
+
const focusable = getFirstFocusableDescendant(composedChildren[i], includeHidden, predicate, includeTabbablesOnly);
|
|
49
49
|
if (focusable) return focusable;
|
|
50
50
|
}
|
|
51
51
|
|
package/helpers/prism.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
2
|
|
|
3
|
-
window.Prism = window.Prism || {};
|
|
4
|
-
Prism.manual = true;
|
|
5
|
-
|
|
6
3
|
const prismLocation = 'https://s.brightspace.com/lib/prismjs/1.28.0';
|
|
7
4
|
//const prismLocation = '/node_modules/prismjs'; // for local debugging
|
|
8
5
|
|
|
@@ -407,6 +404,12 @@ let prismLoaded;
|
|
|
407
404
|
const loadPrism = () => {
|
|
408
405
|
if (prismLoaded) return prismLoaded;
|
|
409
406
|
|
|
407
|
+
// Set Prism to manual mode before loading to make sure
|
|
408
|
+
// we don't automatically highlight before we finish
|
|
409
|
+
// configuring it.
|
|
410
|
+
window.Prism = window.Prism || {};
|
|
411
|
+
Prism.manual = true;
|
|
412
|
+
|
|
410
413
|
prismLoaded = Promise.all([
|
|
411
414
|
new Promise(resolve => {
|
|
412
415
|
const script = document.createElement('script');
|
package/lang/ar.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "المزيد",
|
|
93
93
|
"components.overflow-group.moreActions": "مزيد من الإجراءات",
|
|
94
94
|
"components.pager-load-more.action": "تحميل {count} إضافي",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} من أصل {totalCountFormatted} من العناصر} other {{showingCount} من أصل {totalCountFormatted} من العناصر}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "تحميل المزيد من المواد",
|
|
97
97
|
"components.selection.action-hint": "حدد مادة لتنفيذ هذا الإجراء.",
|
|
98
98
|
"components.selection.select-all": "تحديد الكل",
|
package/lang/da.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "flere",
|
|
93
93
|
"components.overflow-group.moreActions": "Flere handlinger",
|
|
94
94
|
"components.pager-load-more.action": "Indlæs {count} mere",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} af {totalCountFormatted} element} other {{showingCount} af {totalCountFormatted} elementer}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Indlæser flere elementer",
|
|
97
97
|
"components.selection.action-hint": "Vælg et element for at udføre denne handling.",
|
|
98
98
|
"components.selection.select-all": "Vælg alle",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.48.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",
|