@brightspace-ui/core 2.43.2 → 2.43.5
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.
|
@@ -320,7 +320,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
320
320
|
firstUpdated(changedProperties) {
|
|
321
321
|
super.firstUpdated(changedProperties);
|
|
322
322
|
|
|
323
|
-
this.__content = this.
|
|
323
|
+
this.__content = this.getContentContainer();
|
|
324
324
|
this.addEventListener('d2l-dropdown-close', this.__onClose);
|
|
325
325
|
this.addEventListener('d2l-dropdown-position', this.__toggleScrollStyles);
|
|
326
326
|
}
|
|
@@ -363,6 +363,10 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
363
363
|
*/
|
|
364
364
|
forceRender() {}
|
|
365
365
|
|
|
366
|
+
getContentContainer() {
|
|
367
|
+
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-container');
|
|
368
|
+
}
|
|
369
|
+
|
|
366
370
|
/**
|
|
367
371
|
* Private.
|
|
368
372
|
*/
|
|
@@ -435,10 +439,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
435
439
|
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-bottom');
|
|
436
440
|
}
|
|
437
441
|
|
|
438
|
-
__getContentContainer() {
|
|
439
|
-
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-container');
|
|
440
|
-
}
|
|
441
|
-
|
|
442
442
|
__getContentTop() {
|
|
443
443
|
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-top');
|
|
444
444
|
}
|
|
@@ -473,7 +473,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
475
|
const rootTarget = e.composedPath()[0];
|
|
476
|
-
const clickInside = isComposedAncestor(this.
|
|
476
|
+
const clickInside = isComposedAncestor(this.getContentContainer(), rootTarget) ||
|
|
477
477
|
isComposedAncestor(this.__getContentTop(), rootTarget) ||
|
|
478
478
|
isComposedAncestor(this.__getContentBottom(), rootTarget);
|
|
479
479
|
if (clickInside) {
|
|
@@ -533,7 +533,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
533
533
|
async __openedChanged(newValue) {
|
|
534
534
|
|
|
535
535
|
// DE44538: wait for dropdown content to fully render,
|
|
536
|
-
// otherwise this.
|
|
536
|
+
// otherwise this.getContentContainer() can return null.
|
|
537
537
|
await this.updateComplete;
|
|
538
538
|
|
|
539
539
|
this.__previousFocusableAncestor =
|
|
@@ -543,7 +543,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
543
543
|
|
|
544
544
|
const doOpen = async() => {
|
|
545
545
|
|
|
546
|
-
const content = this.
|
|
546
|
+
const content = this.getContentContainer();
|
|
547
547
|
|
|
548
548
|
if (!this.noAutoFit) {
|
|
549
549
|
content.scrollTop = 0;
|
|
@@ -611,7 +611,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
613
|
|
|
614
|
-
const content = this.
|
|
614
|
+
const content = this.getContentContainer();
|
|
615
615
|
const header = this.__getContentTop();
|
|
616
616
|
const footer = this.__getContentBottom();
|
|
617
617
|
|
|
@@ -1043,7 +1043,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
|
|
|
1043
1043
|
|
|
1044
1044
|
_handleFocusTrapEnter() {
|
|
1045
1045
|
if (this.__applyFocus && !this.noAutoFocus) {
|
|
1046
|
-
const content = this.
|
|
1046
|
+
const content = this.getContentContainer();
|
|
1047
1047
|
const focusable = getFirstFocusableDescendant(content);
|
|
1048
1048
|
if (focusable) {
|
|
1049
1049
|
// Removing the rAF call can allow infinite focus looping to happen in content using a focus trap
|
|
@@ -88,7 +88,8 @@ class VisibilitySwitch extends LocalizeCoreElement(SwitchMixin(LitElement)) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
_handleConditionsSlotChange(e) {
|
|
91
|
-
|
|
91
|
+
const nodes = e.target.assignedNodes({ flatten: true });
|
|
92
|
+
this._hasConditions = !!nodes[0]?.textContent?.trim();
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
|
package/helpers/demo/prism.html
CHANGED
|
@@ -928,7 +928,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
928
928
|
firstUpdated(changedProperties) {
|
|
929
929
|
super.firstUpdated(changedProperties);
|
|
930
930
|
|
|
931
|
-
this.__content = this.
|
|
931
|
+
this.__content = this.getContentContainer();
|
|
932
932
|
this.addEventListener('d2l-dropdown-close', this.__onClose);
|
|
933
933
|
this.addEventListener('d2l-dropdown-position', this.__toggleScrollStyles);
|
|
934
934
|
}
|
|
@@ -971,6 +971,10 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
971
971
|
*/
|
|
972
972
|
forceRender() {}
|
|
973
973
|
|
|
974
|
+
getContentContainer() {
|
|
975
|
+
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-container');
|
|
976
|
+
}
|
|
977
|
+
|
|
974
978
|
/**
|
|
975
979
|
* Private.
|
|
976
980
|
*/
|
|
@@ -1043,10 +1047,6 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
1043
1047
|
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-bottom');
|
|
1044
1048
|
}
|
|
1045
1049
|
|
|
1046
|
-
__getContentContainer() {
|
|
1047
|
-
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-container');
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
1050
|
__getContentTop() {
|
|
1051
1051
|
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-dropdown-content-top');
|
|
1052
1052
|
}
|
|
@@ -1081,7 +1081,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
1081
1081
|
return;
|
|
1082
1082
|
}
|
|
1083
1083
|
const rootTarget = e.composedPath()[0];
|
|
1084
|
-
const clickInside = isComposedAncestor(this.
|
|
1084
|
+
const clickInside = isComposedAncestor(this.getContentContainer(), rootTarget) ||
|
|
1085
1085
|
isComposedAncestor(this.__getContentTop(), rootTarget) ||
|
|
1086
1086
|
isComposedAncestor(this.__getContentBottom(), rootTarget);
|
|
1087
1087
|
if (clickInside) {
|
|
@@ -1141,7 +1141,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
1141
1141
|
async __openedChanged(newValue) {
|
|
1142
1142
|
|
|
1143
1143
|
// DE44538: wait for dropdown content to fully render,
|
|
1144
|
-
// otherwise this.
|
|
1144
|
+
// otherwise this.getContentContainer() can return null.
|
|
1145
1145
|
await this.updateComplete;
|
|
1146
1146
|
|
|
1147
1147
|
this.__previousFocusableAncestor =
|
|
@@ -1151,7 +1151,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
1151
1151
|
|
|
1152
1152
|
const doOpen = async() => {
|
|
1153
1153
|
|
|
1154
|
-
const content = this.
|
|
1154
|
+
const content = this.getContentContainer();
|
|
1155
1155
|
|
|
1156
1156
|
if (!this.noAutoFit) {
|
|
1157
1157
|
content.scrollTop = 0;
|
|
@@ -1219,7 +1219,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
1219
1219
|
return;
|
|
1220
1220
|
}
|
|
1221
1221
|
|
|
1222
|
-
const content = this.
|
|
1222
|
+
const content = this.getContentContainer();
|
|
1223
1223
|
const header = this.__getContentTop();
|
|
1224
1224
|
const footer = this.__getContentBottom();
|
|
1225
1225
|
|
|
@@ -1651,7 +1651,7 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreE
|
|
|
1651
1651
|
|
|
1652
1652
|
_handleFocusTrapEnter() {
|
|
1653
1653
|
if (this.__applyFocus && !this.noAutoFocus) {
|
|
1654
|
-
const content = this.
|
|
1654
|
+
const content = this.getContentContainer();
|
|
1655
1655
|
const focusable = getFirstFocusableDescendant(content);
|
|
1656
1656
|
if (focusable) {
|
|
1657
1657
|
// Removing the rAF call can allow infinite focus looping to happen in content using a focus trap
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.43.
|
|
3
|
+
"version": "2.43.5",
|
|
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",
|