@brightspace-ui/core 2.60.0 → 2.61.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.
|
@@ -87,10 +87,12 @@ export const SelectionObserverMixin = superclass => class extends superclass {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
_handleSelectionObserverSubscribe(e) {
|
|
90
|
-
if (
|
|
90
|
+
if (this._provider) {
|
|
91
|
+
const target = e.composedPath()[0];
|
|
92
|
+
if (target === this) return;
|
|
93
|
+
|
|
91
94
|
e.stopPropagation();
|
|
92
95
|
e.detail.provider = this._provider;
|
|
93
|
-
const target = e.composedPath()[0];
|
|
94
96
|
this._provider.subscribeObserver(target);
|
|
95
97
|
}
|
|
96
98
|
}
|
package/custom-elements.json
CHANGED
|
@@ -10126,7 +10126,30 @@
|
|
|
10126
10126
|
},
|
|
10127
10127
|
{
|
|
10128
10128
|
"name": "d2l-test-selection-observer-shadow",
|
|
10129
|
-
"path": "./components/selection/test/selection-component.js"
|
|
10129
|
+
"path": "./components/selection/test/selection-component.js",
|
|
10130
|
+
"attributes": [
|
|
10131
|
+
{
|
|
10132
|
+
"name": "selection-for",
|
|
10133
|
+
"description": "Id of the `SelectionMixin` component this component wants to observe (if not located within that component)",
|
|
10134
|
+
"type": "string"
|
|
10135
|
+
}
|
|
10136
|
+
],
|
|
10137
|
+
"properties": [
|
|
10138
|
+
{
|
|
10139
|
+
"name": "selectionFor",
|
|
10140
|
+
"attribute": "selection-for",
|
|
10141
|
+
"description": "Id of the `SelectionMixin` component this component wants to observe (if not located within that component)",
|
|
10142
|
+
"type": "string"
|
|
10143
|
+
},
|
|
10144
|
+
{
|
|
10145
|
+
"name": "selectionInfo"
|
|
10146
|
+
}
|
|
10147
|
+
],
|
|
10148
|
+
"events": [
|
|
10149
|
+
{
|
|
10150
|
+
"name": "d2l-selection-observer-subscribe"
|
|
10151
|
+
}
|
|
10152
|
+
]
|
|
10130
10153
|
},
|
|
10131
10154
|
{
|
|
10132
10155
|
"name": "d2l-test-skeleton-box",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.61.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",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getComposedChildren } from '../helpers/dom.js';
|
|
1
2
|
|
|
2
3
|
export function keyDown(element, keycode) {
|
|
3
4
|
const event = new CustomEvent('keydown', {
|
|
@@ -10,3 +11,18 @@ export function keyDown(element, keycode) {
|
|
|
10
11
|
event.code = keycode;
|
|
11
12
|
element.dispatchEvent(event);
|
|
12
13
|
}
|
|
14
|
+
|
|
15
|
+
export async function getUpdateCompleteAll(node) {
|
|
16
|
+
|
|
17
|
+
if (!node || (node.nodeType !== Node.ELEMENT_NODE && node.nodeType !== Node.DOCUMENT_NODE && node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE)) {
|
|
18
|
+
throw new TypeError('Invalid node. Must be nodeType document, element or document fragment');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const getUpdateComplete = async elem => {
|
|
22
|
+
if (elem.updateComplete) await elem.updateComplete;
|
|
23
|
+
const childElements = getComposedChildren(elem);
|
|
24
|
+
await Promise.all(childElements.map(childElement => getUpdateComplete(childElement)));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return getUpdateComplete(node);
|
|
28
|
+
}
|