@brightspace-ui/core 3.219.7 → 3.219.9
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.
|
@@ -64,7 +64,7 @@ class LoadingBackdrop extends LitElement {
|
|
|
64
64
|
:host([_state="shown"]) d2l-loading-spinner {
|
|
65
65
|
opacity: 1;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
:host([_state="hiding"]) .d2l-backdrop,
|
|
69
69
|
:host([_state="hiding"]) d2l-loading-spinner {
|
|
70
70
|
transition: opacity ${FADE_DURATION_MS}ms ease-out;
|
|
@@ -111,7 +111,13 @@ class LoadingBackdrop extends LitElement {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
#fade() {
|
|
114
|
-
|
|
114
|
+
let hideImmediately = reduceMotion || this._state === 'showing';
|
|
115
|
+
if (this._state === 'shown') {
|
|
116
|
+
const currentOpacity = getComputedStyle(this.shadowRoot.querySelector('.backdrop')).opacity;
|
|
117
|
+
hideImmediately ||= (currentOpacity === '0');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (hideImmediately) {
|
|
115
121
|
this.#hide();
|
|
116
122
|
} else {
|
|
117
123
|
this._state = 'hiding';
|
|
@@ -3,7 +3,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
3
3
|
|
|
4
4
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
5
5
|
|
|
6
|
-
const states = {
|
|
6
|
+
export const states = {
|
|
7
7
|
PRECOLLAPSING: 'precollapsing', // setting up the styles so the collapse transition will run
|
|
8
8
|
COLLAPSING: 'collapsing', // in the process of collapsing
|
|
9
9
|
COLLAPSED: 'collapsed', // fully collapsed
|
|
@@ -88,6 +88,7 @@ class ExpandCollapseContent extends LitElement {
|
|
|
88
88
|
this._height = '0';
|
|
89
89
|
this._isFirstUpdate = true;
|
|
90
90
|
this._state = states.COLLAPSED;
|
|
91
|
+
this._reduceMotion = reduceMotion;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
render() {
|
|
@@ -118,7 +119,7 @@ class ExpandCollapseContent extends LitElement {
|
|
|
118
119
|
{ bubbles: true, detail: { expandComplete: eventPromise } }
|
|
119
120
|
));
|
|
120
121
|
}
|
|
121
|
-
if (
|
|
122
|
+
if (this._reduceMotion || firstUpdate) {
|
|
122
123
|
this._setExpanded();
|
|
123
124
|
} else {
|
|
124
125
|
this._state = states.PREEXPANDING;
|
|
@@ -139,7 +140,7 @@ class ExpandCollapseContent extends LitElement {
|
|
|
139
140
|
{ bubbles: true, detail: { collapseComplete: eventPromise } }
|
|
140
141
|
));
|
|
141
142
|
}
|
|
142
|
-
if (
|
|
143
|
+
if (this._reduceMotion || firstUpdate) {
|
|
143
144
|
this._state = states.COLLAPSED;
|
|
144
145
|
this._height = '0';
|
|
145
146
|
this._eventPromiseResolve();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.219.
|
|
3
|
+
"version": "3.219.9",
|
|
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",
|