@brightspace-ui/core 2.128.4 → 2.129.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.
|
@@ -200,9 +200,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
200
200
|
_closing: {
|
|
201
201
|
type: Boolean
|
|
202
202
|
},
|
|
203
|
-
_contentOverflow: {
|
|
204
|
-
type: Boolean
|
|
205
|
-
},
|
|
206
203
|
_dropdownContent: {
|
|
207
204
|
type: Boolean,
|
|
208
205
|
attribute: 'dropdown-content',
|
|
@@ -262,7 +259,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
262
259
|
this._bottomOverflow = false;
|
|
263
260
|
this._topOverflow = false;
|
|
264
261
|
this._closing = false;
|
|
265
|
-
this._contentOverflow = false;
|
|
266
262
|
this._hasHeader = false;
|
|
267
263
|
this._hasFooter = false;
|
|
268
264
|
this._showBackdrop = false;
|
|
@@ -704,7 +700,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
704
700
|
&& headerFooterHeight < this.maxHeight
|
|
705
701
|
? this.maxHeight - headerFooterHeight - 2
|
|
706
702
|
: availableHeight - headerFooterHeight;
|
|
707
|
-
this.__toggleOverflowY(contentRect.height + headerFooterHeight > availableHeight);
|
|
708
703
|
|
|
709
704
|
// ensure the content height has updated when the __toggleScrollStyles event handler runs
|
|
710
705
|
await this.updateComplete;
|
|
@@ -723,16 +718,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
723
718
|
await adjustPosition();
|
|
724
719
|
}
|
|
725
720
|
|
|
726
|
-
__toggleOverflowY(isOverflowing) {
|
|
727
|
-
if (!this.__content) {
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
if (!this._contentHeight) {
|
|
731
|
-
return;
|
|
732
|
-
}
|
|
733
|
-
this._contentOverflow = isOverflowing || this.__content.scrollHeight > this._contentHeight;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
721
|
__toggleScrollStyles() {
|
|
737
722
|
/* scrollHeight incorrect in IE by 4px second time opened */
|
|
738
723
|
this._bottomOverflow = this.__content.scrollHeight - (this.__content.scrollTop + this.__content.clientHeight) >= 5;
|
|
@@ -809,7 +794,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
809
794
|
const contentStyle = {
|
|
810
795
|
...contentWidthStyle,
|
|
811
796
|
maxHeight: maxHeightOverride,
|
|
812
|
-
overflowY: this._contentOverflow ? 'auto' : 'hidden'
|
|
813
797
|
};
|
|
814
798
|
|
|
815
799
|
const closeButtonStyles = {
|
|
@@ -845,7 +829,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
845
829
|
const contentStyle = {
|
|
846
830
|
...contentWidthStyle,
|
|
847
831
|
maxHeight: this._contentHeight ? `${this._contentHeight}px` : '',
|
|
848
|
-
overflowY: this._contentOverflow ? 'auto' : 'hidden'
|
|
849
832
|
};
|
|
850
833
|
|
|
851
834
|
const closeButtonStyle = {
|
|
@@ -951,7 +934,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
951
934
|
const contentStyle = {
|
|
952
935
|
...contentWidthStyle,
|
|
953
936
|
maxHeight: maxHeightOverride,
|
|
954
|
-
overflowY: this._contentOverflow ? 'auto' : 'hidden'
|
|
955
937
|
};
|
|
956
938
|
|
|
957
939
|
const closeButtonStyles = {
|
|
@@ -119,17 +119,17 @@ class ExpandCollapseContent extends LitElement {
|
|
|
119
119
|
));
|
|
120
120
|
}
|
|
121
121
|
if (reduceMotion || firstUpdate) {
|
|
122
|
-
this.
|
|
123
|
-
this._height = 'auto';
|
|
124
|
-
this._eventPromiseResolve();
|
|
122
|
+
this._setExpanded();
|
|
125
123
|
} else {
|
|
126
124
|
this._state = states.PREEXPANDING;
|
|
127
125
|
await this.updateComplete;
|
|
128
126
|
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
|
|
129
127
|
if (this._state === states.PREEXPANDING) {
|
|
130
128
|
this._state = states.EXPANDING;
|
|
131
|
-
const content = this.shadowRoot
|
|
132
|
-
|
|
129
|
+
const content = this.shadowRoot?.querySelector('.d2l-expand-collapse-content-inner');
|
|
130
|
+
const contentHeight = content?.scrollHeight;
|
|
131
|
+
if (contentHeight) this._height = `${contentHeight}px`;
|
|
132
|
+
if (contentHeight === 0) this._setExpanded();
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
} else {
|
|
@@ -159,14 +159,17 @@ class ExpandCollapseContent extends LitElement {
|
|
|
159
159
|
|
|
160
160
|
_onTransitionEnd() {
|
|
161
161
|
if (this._state === states.EXPANDING) {
|
|
162
|
-
this.
|
|
163
|
-
this._height = 'auto';
|
|
164
|
-
this._eventPromiseResolve();
|
|
162
|
+
this._setExpanded();
|
|
165
163
|
} else if (this._state === states.COLLAPSING) {
|
|
166
164
|
this._state = states.COLLAPSED;
|
|
167
165
|
this._eventPromiseResolve();
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
168
|
|
|
169
|
+
_setExpanded() {
|
|
170
|
+
this._state = states.EXPANDED;
|
|
171
|
+
this._height = 'auto';
|
|
172
|
+
this._eventPromiseResolve();
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
customElements.define('d2l-expand-collapse-content', ExpandCollapseContent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.129.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",
|
|
@@ -45,13 +45,14 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/eslint-parser": "^7",
|
|
47
47
|
"@brightspace-ui/stylelint-config": "^0.8",
|
|
48
|
-
"@brightspace-ui/testing": "^0.
|
|
48
|
+
"@brightspace-ui/testing": "^0.7",
|
|
49
49
|
"@open-wc/semantic-dom-diff": "^0.20",
|
|
50
50
|
"@open-wc/testing": "^3",
|
|
51
51
|
"@rollup/plugin-dynamic-import-vars": "^2",
|
|
52
52
|
"@rollup/plugin-node-resolve": "^15",
|
|
53
53
|
"@rollup/plugin-replace": "^5",
|
|
54
54
|
"@web/dev-server": "^0.2",
|
|
55
|
+
"@web/test-runner": "^0.16",
|
|
55
56
|
"axe-core": "^4",
|
|
56
57
|
"chalk": "^5",
|
|
57
58
|
"eslint": "^8",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { sendKeys, sendMouse } from '@web/test-runner-commands';
|
|
2
|
-
|
|
3
|
-
export const focusWithKeyboard = async(element) => {
|
|
4
|
-
await sendKeys({ press: 'Tab' });
|
|
5
|
-
element.focus({ focusVisible: true });
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const focusWithMouse = async(element) => {
|
|
9
|
-
const { x, y } = element.getBoundingClientRect();
|
|
10
|
-
await sendMouse({ type: 'click', position: [Math.ceil(x), Math.ceil(y)] });
|
|
11
|
-
await sendMouse({ type: 'move', position: [0, 0] });
|
|
12
|
-
};
|