@brightspace-ui/core 1.196.3 → 1.197.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.
|
@@ -33,7 +33,7 @@ export const radioStyles = css`
|
|
|
33
33
|
border-color: var(--d2l-color-galena);
|
|
34
34
|
border-width: 1px;
|
|
35
35
|
}
|
|
36
|
-
.d2l-
|
|
36
|
+
.d2l-input-radio.d2l-hovering,
|
|
37
37
|
.d2l-input-radio:hover,
|
|
38
38
|
.d2l-input-radio:focus,
|
|
39
39
|
.d2l-input-radio-label > input[type="radio"]:hover,
|
|
@@ -47,6 +47,7 @@ export const radioStyles = css`
|
|
|
47
47
|
border-color: var(--d2l-color-cinnabar);
|
|
48
48
|
}
|
|
49
49
|
.d2l-input-radio:disabled,
|
|
50
|
+
.d2l-input-radio.d2l-disabled,
|
|
50
51
|
.d2l-input-radio-label > input[type="radio"]:disabled {
|
|
51
52
|
opacity: 0.5;
|
|
52
53
|
}
|
|
@@ -152,6 +152,7 @@ The `d2l-list` is the container to create a styled list of items using `d2l-list
|
|
|
152
152
|
|
|
153
153
|
- `getListItemCount`: returns the length of the items within the list
|
|
154
154
|
- `getListItemIndex` (Object): returns the index of the given element within the list
|
|
155
|
+
- `getSelectedListItems` (Array): returns the selected items; pass `true` to include nested lists
|
|
155
156
|
- `getSelectionInfo` (Object): returns a `SelectionInfo` object containing the `state` (`none`, `some`, `all`), and the `keys` (Array) for the selected items
|
|
156
157
|
|
|
157
158
|
## Selection Lists
|
package/components/list/list.js
CHANGED
|
@@ -97,6 +97,17 @@ class List extends SelectionMixin(LitElement) {
|
|
|
97
97
|
return this._getItems().indexOf(item);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
getSelectedListItems(includeNested) {
|
|
101
|
+
let selectedItems = [];
|
|
102
|
+
this._getItems().forEach(item => {
|
|
103
|
+
if (item.selected) selectedItems.push(item);
|
|
104
|
+
if (includeNested && item._selectionProvider) {
|
|
105
|
+
selectedItems = [...selectedItems, ...item._selectionProvider.getSelectedListItems(includeNested)];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return selectedItems;
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
getSelectionInfo(includeNested) {
|
|
101
112
|
const selectionInfo = super.getSelectionInfo();
|
|
102
113
|
if (!includeNested) return selectionInfo;
|
|
@@ -89,10 +89,12 @@ class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
|
|
|
89
89
|
'd2l-input-radio': true,
|
|
90
90
|
'd2l-selection-input-radio': true,
|
|
91
91
|
'd2l-skeletize': true,
|
|
92
|
-
'd2l-hovering': this.hovering
|
|
92
|
+
'd2l-hovering': this.hovering,
|
|
93
|
+
'd2l-disabled': this.disabled
|
|
93
94
|
};
|
|
94
95
|
return html`
|
|
95
96
|
<div
|
|
97
|
+
aria-disabled="${ifDefined(this.disabled)}"
|
|
96
98
|
aria-label="${this.label}"
|
|
97
99
|
aria-checked="${this.selected ? 'true' : 'false'}"
|
|
98
100
|
class="${classMap(radioClasses)}"
|
|
@@ -100,7 +102,7 @@ class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
|
|
|
100
102
|
@keydown="${this._handleRadioKeyDown}"
|
|
101
103
|
@keyup="${this._handleRadioKeyUp}"
|
|
102
104
|
role="radio"
|
|
103
|
-
tabindex="0"></div>
|
|
105
|
+
tabindex="${ifDefined(this.disabled ? undefined : 0)}"></div>
|
|
104
106
|
`;
|
|
105
107
|
} else {
|
|
106
108
|
return html`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.197.0",
|
|
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": {
|