@brightspace-ui/core 1.215.0 → 1.216.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.
- package/components/button/button-mixin.js +1 -1
- package/components/calendar/calendar.js +5 -5
- package/components/card/card-footer-link.js +2 -2
- package/components/card/card.js +1 -1
- package/components/demo/code-view.js +2 -2
- package/components/demo/demo-snippet.js +5 -2
- package/components/dialog/dialog-confirm.js +1 -0
- package/components/dialog/dialog-mixin.js +7 -2
- package/components/dropdown/dropdown-button-subtle.js +1 -1
- package/components/dropdown/dropdown-button.js +1 -1
- package/components/dropdown/dropdown-content-mixin.js +6 -6
- package/components/dropdown/dropdown-context-menu.js +1 -1
- package/components/dropdown/dropdown-menu.js +1 -0
- package/components/dropdown/dropdown-more.js +1 -1
- package/components/dropdown/dropdown-opener-mixin.js +1 -0
- package/components/dropdown/dropdown-tabs.js +1 -0
- package/components/dropdown/dropdown.js +1 -0
- package/components/expand-collapse/expand-collapse-content.js +4 -4
- package/components/filter/filter.js +5 -4
- package/components/focus-trap/focus-trap.js +6 -5
- package/components/form/demo/form-demo.js +1 -1
- package/components/form/demo/form-dialog-demo.js +4 -4
- package/components/form/demo/form-native-demo.js +1 -1
- package/components/form/form-element-mixin.js +12 -3
- package/components/form/form-errory-summary.js +2 -2
- package/components/form/form-native.js +1 -1
- package/components/form/form.js +1 -1
- package/components/hierarchical-view/hierarchical-view-mixin.js +7 -6
- package/components/html-block/html-block.js +1 -0
- package/components/inputs/demo/input-radio-solo-test.js +1 -1
- package/components/inputs/demo/input-radio-spacer-test.js +1 -1
- package/components/inputs/demo/input-select-test.js +1 -1
- package/components/inputs/input-checkbox.js +1 -1
- package/components/inputs/input-date-range.js +4 -3
- package/components/inputs/input-date-time-range-to.js +1 -1
- package/components/inputs/input-date-time-range.js +4 -3
- package/components/inputs/input-date-time.js +6 -5
- package/components/inputs/input-date.js +3 -0
- package/components/inputs/input-number.js +2 -1
- package/components/inputs/input-percent.js +2 -1
- package/components/inputs/input-search.js +3 -3
- package/components/inputs/input-text.js +8 -8
- package/components/inputs/input-textarea.js +5 -5
- package/components/inputs/input-time-range.js +4 -4
- package/components/inputs/input-time.js +1 -1
- package/components/link/link.js +1 -1
- package/components/list/demo/list-drag-and-drop.js +1 -0
- package/components/list/list-item-checkbox-mixin.js +1 -1
- package/components/list/list-item-drag-drop-mixin.js +10 -5
- package/components/list/list-item-generic-layout.js +5 -4
- package/components/list/list-item-mixin.js +1 -0
- package/components/list/list.js +2 -0
- package/components/menu/demo/custom-view.js +1 -1
- package/components/menu/menu-item-link.js +1 -1
- package/components/menu/menu-item-mixin.js +1 -1
- package/components/menu/menu.js +2 -2
- package/components/overflow-group/overflow-group.js +1 -1
- package/components/scroll-wrapper/demo/scroll-wrapper-test.js +1 -1
- package/components/selection/selection-action.js +1 -1
- package/components/selection/selection-input.js +1 -1
- package/components/selection/selection-select-all.js +1 -1
- package/components/switch/switch-mixin.js +1 -1
- package/components/table/table-col-sort-button.js +1 -1
- package/components/tabs/tabs.js +20 -15
- package/components/tooltip/tooltip.js +1 -1
- package/helpers/demo/announce-test.js +1 -0
- package/mixins/arrow-keys-mixin.js +3 -1
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +2 -1
package/components/tabs/tabs.js
CHANGED
|
@@ -374,34 +374,37 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
getTabListRect() {
|
|
377
|
+
if (!this.shadowRoot) return undefined;
|
|
377
378
|
return this.shadowRoot.querySelector('.d2l-tabs-container-list').getBoundingClientRect();
|
|
378
379
|
}
|
|
379
380
|
|
|
380
381
|
_animateTabAddition(tabInfo) {
|
|
381
|
-
const tab = this.shadowRoot
|
|
382
|
+
const tab = this.shadowRoot
|
|
383
|
+
&& this.shadowRoot.querySelector(`d2l-tab-internal[controls-panel="${cssEscape(tabInfo.id)}"]`);
|
|
382
384
|
return new Promise((resolve) => {
|
|
383
385
|
const handleTransitionEnd = (e) => {
|
|
384
386
|
if (e.propertyName !== 'max-width') return;
|
|
385
|
-
tab.removeEventListener('transitionend', handleTransitionEnd);
|
|
387
|
+
if (tab) tab.removeEventListener('transitionend', handleTransitionEnd);
|
|
386
388
|
resolve();
|
|
387
389
|
};
|
|
388
|
-
tab.addEventListener('transitionend', handleTransitionEnd);
|
|
390
|
+
if (tab) tab.addEventListener('transitionend', handleTransitionEnd);
|
|
389
391
|
tabInfo.state = '';
|
|
390
392
|
this.requestUpdate();
|
|
391
393
|
});
|
|
392
394
|
}
|
|
393
395
|
|
|
394
396
|
_animateTabRemoval(tabInfo) {
|
|
395
|
-
const tab = this.shadowRoot
|
|
397
|
+
const tab = this.shadowRoot &&
|
|
398
|
+
this.shadowRoot.querySelector(`d2l-tab-internal[controls-panel="${cssEscape(tabInfo.id)}"]`);
|
|
396
399
|
return new Promise((resolve) => {
|
|
397
400
|
const handleTransitionEnd = (e) => {
|
|
398
401
|
if (e.propertyName !== 'max-width') return;
|
|
399
|
-
tab.removeEventListener('transitionend', handleTransitionEnd);
|
|
402
|
+
if (tab) tab.removeEventListener('transitionend', handleTransitionEnd);
|
|
400
403
|
this._tabInfos.splice(this._tabInfos.findIndex(info => info.id === tabInfo.id), 1);
|
|
401
404
|
this.requestUpdate();
|
|
402
405
|
resolve();
|
|
403
406
|
};
|
|
404
|
-
tab.addEventListener('transitionend', handleTransitionEnd);
|
|
407
|
+
if (tab) tab.addEventListener('transitionend', handleTransitionEnd);
|
|
405
408
|
});
|
|
406
409
|
}
|
|
407
410
|
|
|
@@ -488,7 +491,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
488
491
|
}
|
|
489
492
|
|
|
490
493
|
async _focusSelected() {
|
|
491
|
-
const selectedTab = this.shadowRoot.querySelector('d2l-tab-internal[aria-selected="true"]');
|
|
494
|
+
const selectedTab = this.shadowRoot && this.shadowRoot.querySelector('d2l-tab-internal[aria-selected="true"]');
|
|
492
495
|
if (!selectedTab) return;
|
|
493
496
|
|
|
494
497
|
const selectedTabInfo = this._getTabInfo(selectedTab.controlsPanel);
|
|
@@ -517,6 +520,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
517
520
|
}
|
|
518
521
|
|
|
519
522
|
_getPanel(id) {
|
|
523
|
+
if (!this.shadowRoot) return;
|
|
520
524
|
// use simple selector for slot (Edge)
|
|
521
525
|
const slot = this.shadowRoot.querySelector('.d2l-panels-container').querySelector('slot');
|
|
522
526
|
const panels = this._getPanels(slot);
|
|
@@ -702,7 +706,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
702
706
|
await this._scrollToPosition(newTranslationValue);
|
|
703
707
|
await this._updateScrollVisibility(newMeasures);
|
|
704
708
|
|
|
705
|
-
if (!isOverflowingNext) {
|
|
709
|
+
if (!isOverflowingNext && this.shadowRoot) {
|
|
706
710
|
this.shadowRoot.querySelector('.d2l-tabs-scroll-previous-container button').focus();
|
|
707
711
|
}
|
|
708
712
|
|
|
@@ -735,7 +739,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
735
739
|
await this._scrollToPosition(newTranslationValue);
|
|
736
740
|
await this._updateScrollVisibility(newMeasures);
|
|
737
741
|
|
|
738
|
-
if (!isOverflowingPrevious) {
|
|
742
|
+
if (!isOverflowingPrevious && this.shadowRoot) {
|
|
739
743
|
this.shadowRoot.querySelector('.d2l-tabs-scroll-next-container button').focus();
|
|
740
744
|
}
|
|
741
745
|
|
|
@@ -777,7 +781,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
777
781
|
}
|
|
778
782
|
|
|
779
783
|
this._translationValue = translationValue;
|
|
780
|
-
if (reduceMotion) return this.updateComplete;
|
|
784
|
+
if (!this.shadowRoot || reduceMotion) return this.updateComplete;
|
|
781
785
|
|
|
782
786
|
return new Promise((resolve) => {
|
|
783
787
|
const tabList = this.shadowRoot.querySelector('.d2l-tabs-container-list');
|
|
@@ -805,13 +809,13 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
805
809
|
expandedPromise = this.updateComplete;
|
|
806
810
|
} else {
|
|
807
811
|
expandedPromise = new Promise((resolve) => {
|
|
808
|
-
const tabsContainer = this.shadowRoot.querySelector('.d2l-tabs-container');
|
|
812
|
+
const tabsContainer = this.shadowRoot && this.shadowRoot.querySelector('.d2l-tabs-container');
|
|
809
813
|
const handleTransitionEnd = (e) => {
|
|
810
814
|
if (e.propertyName !== 'max-width') return;
|
|
811
|
-
tabsContainer.removeEventListener('transitionend', handleTransitionEnd);
|
|
815
|
+
if (tabsContainer) tabsContainer.removeEventListener('transitionend', handleTransitionEnd);
|
|
812
816
|
resolve();
|
|
813
817
|
};
|
|
814
|
-
tabsContainer.addEventListener('transitionend', handleTransitionEnd);
|
|
818
|
+
if (tabsContainer) tabsContainer.addEventListener('transitionend', handleTransitionEnd);
|
|
815
819
|
this._scrollCollapsed = false;
|
|
816
820
|
this._maxWidth = measures.totalTabsWidth + 50;
|
|
817
821
|
});
|
|
@@ -828,7 +832,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
828
832
|
if (!this._allowScrollPrevious) {
|
|
829
833
|
this._focusSelected();
|
|
830
834
|
} else {
|
|
831
|
-
this.shadowRoot.querySelector('.d2l-tabs-scroll-previous-container button').focus();
|
|
835
|
+
if (this.shadowRoot) this.shadowRoot.querySelector('.d2l-tabs-scroll-previous-container button').focus();
|
|
832
836
|
}
|
|
833
837
|
}
|
|
834
838
|
|
|
@@ -838,6 +842,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
838
842
|
|
|
839
843
|
_updateMeasures() {
|
|
840
844
|
let totalTabsWidth = 0;
|
|
845
|
+
if (!this.shadowRoot) return;
|
|
841
846
|
const tabs = [...this.shadowRoot.querySelectorAll('d2l-tab-internal')];
|
|
842
847
|
|
|
843
848
|
const tabRects = tabs.map((tab) => {
|
|
@@ -894,7 +899,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
|
|
|
894
899
|
// don't animate the tabs list visibility if it's the inital render
|
|
895
900
|
if (reduceMotion || !this._initialized) {
|
|
896
901
|
this._state = 'hidden';
|
|
897
|
-
} else {
|
|
902
|
+
} else if (this.shadowRoot) {
|
|
898
903
|
const layout = this.shadowRoot.querySelector('.d2l-tabs-layout');
|
|
899
904
|
const handleTransitionEnd = (e) => {
|
|
900
905
|
if (e.propertyName !== 'max-height') return;
|
|
@@ -715,7 +715,7 @@ class Tooltip extends RtlMixin(LitElement) {
|
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
_getContent() {
|
|
718
|
-
return this.shadowRoot.querySelector('.d2l-tooltip-content');
|
|
718
|
+
return this.shadowRoot && this.shadowRoot.querySelector('.d2l-tooltip-content');
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
_isAboveOrBelow() {
|
|
@@ -25,6 +25,7 @@ class AnnounceTest extends LitElement {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
_handleAnnounce() {
|
|
28
|
+
if (!this.shadowRoot) return;
|
|
28
29
|
const value1 = this.shadowRoot.querySelector('#msg1').value;
|
|
29
30
|
if (value1.length > 0) announce(value1);
|
|
30
31
|
const value2 = this.shadowRoot.querySelector('#msg2').value;
|
|
@@ -37,7 +37,9 @@ export const ArrowKeysMixin = superclass => class extends superclass {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
async arrowKeysFocusablesProvider() {
|
|
40
|
-
return
|
|
40
|
+
return this.shadowRoot ?
|
|
41
|
+
[...this.shadowRoot.querySelectorAll('.d2l-arrowkeys-focusable')]
|
|
42
|
+
: [];
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
async _focus(elem) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.216.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",
|
|
@@ -1014,6 +1014,7 @@ class TemplatePrimarySecondary extends FocusVisiblePolyfillMixin(RtlMixin(Locali
|
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
1016
|
_computeContentBounds(contentRect) {
|
|
1017
|
+
if (!this.shadowRoot) return;
|
|
1017
1018
|
const divider = this.shadowRoot.querySelector('.d2l-template-primary-secondary-divider');
|
|
1018
1019
|
const desktopDividerSize = divider.offsetWidth;
|
|
1019
1020
|
const mobileDividerSize = divider.offsetHeight;
|
|
@@ -1057,7 +1058,7 @@ class TemplatePrimarySecondary extends FocusVisiblePolyfillMixin(RtlMixin(Locali
|
|
|
1057
1058
|
} else {
|
|
1058
1059
|
if (this._isMobile) {
|
|
1059
1060
|
this._size = this._contentBounds.minHeight;
|
|
1060
|
-
} else {
|
|
1061
|
+
} else if (this.shadowRoot) {
|
|
1061
1062
|
const divider = this.shadowRoot.querySelector('.d2l-template-primary-secondary-divider');
|
|
1062
1063
|
const desktopDividerSize = contentRect.width - divider.offsetWidth;
|
|
1063
1064
|
this._size = Math.max(desktopMinSize, desktopDividerSize * (1 / 3));
|