@brightspace-ui/core 2.14.2 → 2.14.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.
- package/components/html-block/html-block.js +2 -0
- package/components/tag-list/demo/tag-list.html +1 -1
- package/components/tag-list/tag-list.js +1 -1
- package/lang/ar.js +2 -2
- package/lang/cy.js +2 -2
- package/lang/da.js +2 -2
- package/lang/de.js +2 -2
- package/lang/es-es.js +2 -2
- package/lang/es.js +3 -3
- package/lang/fr-fr.js +2 -2
- package/lang/fr.js +2 -2
- package/lang/hi.js +2 -2
- package/lang/ja.js +2 -2
- package/lang/ko.js +2 -2
- package/lang/nl.js +2 -2
- package/lang/pt.js +2 -2
- package/lang/sv.js +2 -2
- package/lang/tr.js +2 -2
- package/lang/zh-cn.js +2 -2
- package/lang/zh-tw.js +2 -2
- package/mixins/interactive-mixin.js +53 -31
- package/package.json +1 -1
|
@@ -203,6 +203,8 @@ class HtmlBlock extends RtlMixin(LitElement) {
|
|
|
203
203
|
super.firstUpdated(changedProperties);
|
|
204
204
|
|
|
205
205
|
if (this._renderContainer) return;
|
|
206
|
+
|
|
207
|
+
// The d2l-html-block-rendered class is used to apply CSS outside of the html-block component. Do not change lightly.
|
|
206
208
|
this.shadowRoot.innerHTML += '<div class="d2l-html-block-rendered'
|
|
207
209
|
+ `${this.compact ? ' d2l-html-block-compact' : ''}`
|
|
208
210
|
+ '"></div><slot'
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
|
|
74
74
|
<h2>Tag List with Interactive</h2>
|
|
75
75
|
<d2l-demo-snippet fullscreen>
|
|
76
|
-
<div
|
|
76
|
+
<div grid>
|
|
77
77
|
<d2l-tag-list description="A bunch of example tags" clearable>
|
|
78
78
|
<d2l-tag-list-item text="Example Tag"></d2l-tag-list-item>
|
|
79
79
|
<d2l-tag-list-item text="Longer Example Tag - much much much much much longer"></d2l-tag-list-item>
|
package/lang/ar.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "زيادة {count} إضافي",
|
|
105
|
+
"components.tag-list.show-less": "إظهار أقل",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "تقسيم العرض القابل للضبط",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "السهم المتّجه إلى اليسار أو إلى اليمين لضبط حجم لوحات العرض",
|
package/lang/cy.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} yn rhagor",
|
|
105
|
+
"components.tag-list.show-less": "Dangos Llai",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Gwedd Hollt Addasadwy",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Saeth i'r chwith neu'r dde i addasu maint y paneli gweld",
|
package/lang/da.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} mere",
|
|
105
|
+
"components.tag-list.show-less": "Vis færre",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Justerbar delt visning",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Pil til venstre eller højre for at justere størrelsen på visningspaneler",
|
package/lang/de.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} weitere",
|
|
105
|
+
"components.tag-list.show-less": "Weniger anzeigen",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Anpassbare geteilte Ansicht",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Pfeil nach links oder rechts, um die Größe der Ansichtsbereiche anzupassen",
|
package/lang/es-es.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} más",
|
|
105
|
+
"components.tag-list.show-less": "Mostrar menos",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Vista dividida ajustable",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Flecha hacia la izquierda o la derecha para ajustar el tamaño de los paneles de visualización",
|
package/lang/es.js
CHANGED
|
@@ -97,12 +97,12 @@ export default {
|
|
|
97
97
|
"components.tabs.next": "Desplazarse hacia adelante",
|
|
98
98
|
"components.tabs.previous": "Desplazarse hacia atrás",
|
|
99
99
|
"components.tag-list.clear": "Click to remove item {value}",
|
|
100
|
+
"components.tag-list.clear-all": "Clear All",
|
|
100
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
101
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
102
|
-
"components.tag-list.clear-all": "Clear All",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} más",
|
|
105
|
+
"components.tag-list.show-less": "Mostrar menos",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Pantalla dividida ajustable",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Utilice la flecha izquierda o derecha para ajustar el tamaño de los paneles de visualización",
|
package/lang/fr-fr.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "{count} de plus",
|
|
105
|
+
"components.tag-list.show-less": "Afficher moins",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Vue fractionnée réglable",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Flèche vers la gauche ou vers la droite pour régler la taille des panneaux d’affichage",
|
package/lang/fr.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} de plus",
|
|
105
|
+
"components.tag-list.show-less": "Afficher moins",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Vue partagée réglable",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Utiliser la flèche vers la gauche ou vers la droite pour régler la taille des volets d'affichage",
|
package/lang/hi.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} और",
|
|
105
|
+
"components.tag-list.show-less": "कम दिखाएँ",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "समायोजन योग्य विभाजन दृश्य",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "दृश्य पैनल्स का आकार समायोजित करने के लिए तीर बाएँ या दाएँ करें",
|
package/lang/ja.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} 件追加",
|
|
105
|
+
"components.tag-list.show-less": "少なく表示",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "調整可能な分割ビュー",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "左矢印または右矢印を使用して、ビューパネルのサイズを調整します",
|
package/lang/ko.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "{count}개 더",
|
|
105
|
+
"components.tag-list.show-less": "간단히 표시",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "조정 가능한 분할 보기",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "왼쪽 또는 오른쪽 화살표로 보기 패널의 크기 조정",
|
package/lang/nl.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} extra",
|
|
105
|
+
"components.tag-list.show-less": "Minder weergeven",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Instelbare gesplitste weergave",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Pijl naar links of rechts om de grootte van de weergavevensters aan te passen",
|
package/lang/pt.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} mais",
|
|
105
|
+
"components.tag-list.show-less": "Mostrar menos",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Exibição dividida ajustável",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Use a seta para a esquerda ou para a direita para ajustar o tamanho dos painéis de exibição",
|
package/lang/sv.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} till",
|
|
105
|
+
"components.tag-list.show-less": "Visa färre",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Justerbar delad vy",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Pil vänster eller höger för att justera storleken på vypaneler",
|
package/lang/tr.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+{count} tane daha",
|
|
105
|
+
"components.tag-list.show-less": "Daha Azını Göster",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "Ayarlanabilir Bölünmüş Görüntü",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "Görüntü panellerinin boyutunu ayarlamak için sol veya sağ okları kullanın",
|
package/lang/zh-cn.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "+ {count}
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "+ {count} 个",
|
|
105
|
+
"components.tag-list.show-less": "显示更少",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "可调分屏视图",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "向左或向右箭头可调整视图面板的大小",
|
package/lang/zh-tw.js
CHANGED
|
@@ -101,8 +101,8 @@ export default {
|
|
|
101
101
|
"components.tag-list.cleared-all": "Removed all tag list items",
|
|
102
102
|
"components.tag-list.cleared-item": "Removed tag list item {value}",
|
|
103
103
|
"components.tag-list.interactive-label": "Tag List, {count} items",
|
|
104
|
-
"components.tag-list.num-hidden": "
|
|
105
|
-
"components.tag-list.show-less": "
|
|
104
|
+
"components.tag-list.num-hidden": "還有 {count} 個",
|
|
105
|
+
"components.tag-list.show-less": "顯示更少",
|
|
106
106
|
"components.tag-list.show-more-description": "Select to show hidden tag list items",
|
|
107
107
|
"templates.primary-secondary.adjustableSplitView": "可調整的分割檢視",
|
|
108
108
|
"templates.primary-secondary.keyboardHorizontal": "向左或向右箭頭可調整檢視面板的大小",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { css, html } from 'lit';
|
|
2
2
|
import { findComposedAncestor, isComposedAncestor } from '../helpers/dom.js';
|
|
3
|
-
import {
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { getNextFocusable } from '../helpers/focus.js';
|
|
4
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
6
|
import { LocalizeCoreElement } from '../helpers/localize-core-element.js';
|
|
7
|
+
import { offscreenStyles } from '../components/offscreen/offscreen.js';
|
|
6
8
|
|
|
7
9
|
const keyCodes = {
|
|
8
10
|
ENTER: 13,
|
|
@@ -13,24 +15,25 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
|
|
|
13
15
|
|
|
14
16
|
static get properties() {
|
|
15
17
|
return {
|
|
18
|
+
_focusingToggle: { state: true },
|
|
16
19
|
_hasInteractiveAncestor: { state: true },
|
|
17
20
|
_interactive: { state: true }
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
static get styles() {
|
|
22
|
-
return css`
|
|
23
|
-
.interactive-
|
|
24
|
-
.interactive-container:focus-visible {
|
|
25
|
+
return [offscreenStyles, css`
|
|
26
|
+
.interactive-focusing-toggle {
|
|
25
27
|
border-radius: 6px;
|
|
26
28
|
outline: 2px solid var(--d2l-color-celestine);
|
|
27
29
|
outline-offset: 2px;
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
`];
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
constructor() {
|
|
33
35
|
super();
|
|
36
|
+
this._focusingToggle = false;
|
|
34
37
|
this._hasInteractiveAncestor = false;
|
|
35
38
|
this._interactive = false;
|
|
36
39
|
}
|
|
@@ -39,14 +42,14 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
|
|
|
39
42
|
super.connectedCallback();
|
|
40
43
|
|
|
41
44
|
const parentGrid = findComposedAncestor(this.parentNode, node => {
|
|
42
|
-
return (
|
|
45
|
+
return (node.nodeType === Node.ELEMENT_NODE && (node.hasAttribute('grid') || node.getAttribute('role') === 'grid'));
|
|
43
46
|
});
|
|
44
47
|
this._hasInteractiveAncestor = (parentGrid !== null);
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
focus() {
|
|
48
51
|
if (!this.shadowRoot) return;
|
|
49
|
-
if (this._hasInteractiveAncestor && !this._interactive)
|
|
52
|
+
if (this._hasInteractiveAncestor && !this._interactive) this.shadowRoot.querySelector('.interactive-toggle').focus();
|
|
50
53
|
else this._focusDelegate();
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -57,18 +60,27 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
|
|
|
57
60
|
if (!focusDelegate) {
|
|
58
61
|
throw new Error(`InteractiveMixin: no focus delegate provided for "${this.tagName}"`);
|
|
59
62
|
}
|
|
63
|
+
|
|
60
64
|
this._focusDelegate = focusDelegate;
|
|
61
65
|
if (!this._hasInteractiveAncestor) return inner;
|
|
66
|
+
|
|
67
|
+
const classes = {
|
|
68
|
+
'interactive-focusing-toggle': this._focusingToggle
|
|
69
|
+
};
|
|
70
|
+
|
|
62
71
|
return html`
|
|
63
|
-
<div class="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
<div class="${classMap(classes)}" @keydown="${this._handleInteractiveKeyDown}">
|
|
73
|
+
<button
|
|
74
|
+
class="interactive-toggle d2l-offscreen"
|
|
75
|
+
@blur="${this._handleInteractiveToggleBlur}"
|
|
76
|
+
@click="${this._handleInteractiveToggleClick}"
|
|
77
|
+
@focus="${this._handleInteractiveToggleFocus}"
|
|
78
|
+
tabindex="${ifDefined(this._hasInteractiveAncestor && !this._interactive ? '0' : '-1')}">
|
|
79
|
+
${`${label}, ${this.localize('components.interactive.instructions')}`}
|
|
80
|
+
</button>
|
|
81
|
+
<span class="interactive-trap-start" @focus="${this._handleInteractiveTrapStartFocus}" tabindex="${ifDefined(this._hasInteractiveAncestor ? '0' : undefined)}"></span>
|
|
70
82
|
<div class="interactive-container-content" @focusin="${this._handleInteractiveContentFocusIn}" @focusout="${this._handleInteractiveContentFocusOut}">${inner}</div>
|
|
71
|
-
<span class="interactive-trap-end" @focus="${this.
|
|
83
|
+
<span class="interactive-trap-end" @focus="${this._handleInteractiveTrapEndFocus}" tabindex="${ifDefined(this._hasInteractiveAncestor ? '0' : undefined)}"></span>
|
|
72
84
|
</div>
|
|
73
85
|
`;
|
|
74
86
|
}
|
|
@@ -83,27 +95,37 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
|
|
|
83
95
|
this._interactive = false;
|
|
84
96
|
}
|
|
85
97
|
|
|
86
|
-
async _handleInteractiveEndFocus() {
|
|
87
|
-
// focus moved to trap-end either forwards from contents or backwards from outside - focus interactive toggle
|
|
88
|
-
this._interactive = false;
|
|
89
|
-
await this.updateComplete;
|
|
90
|
-
this.shadowRoot.querySelector('.interactive-container').focus();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
98
|
async _handleInteractiveKeyDown(e) {
|
|
94
|
-
if (
|
|
95
|
-
this._interactive = true;
|
|
96
|
-
await this.updateComplete;
|
|
97
|
-
this.focus();
|
|
98
|
-
} else if (this._interactive && e.keyCode === keyCodes.ESCAPE) {
|
|
99
|
+
if (this._interactive && e.keyCode === keyCodes.ESCAPE) {
|
|
99
100
|
this._interactive = false;
|
|
100
101
|
await this.updateComplete;
|
|
101
|
-
this.shadowRoot.querySelector('.interactive-
|
|
102
|
+
this.shadowRoot.querySelector('.interactive-toggle').focus();
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
_handleInteractiveToggleBlur() {
|
|
107
|
+
this._focusingToggle = false;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async _handleInteractiveToggleClick() {
|
|
111
|
+
this._interactive = true;
|
|
112
|
+
await this.updateComplete;
|
|
113
|
+
this.focus();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
_handleInteractiveToggleFocus() {
|
|
117
|
+
this._focusingToggle = true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async _handleInteractiveTrapEndFocus() {
|
|
121
|
+
// focus moved to trap-end either forwards from contents or backwards from outside - focus interactive toggle
|
|
122
|
+
this._interactive = false;
|
|
123
|
+
await this.updateComplete;
|
|
124
|
+
this.shadowRoot.querySelector('.interactive-toggle').focus();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async _handleInteractiveTrapStartFocus(e) {
|
|
128
|
+
if (e.relatedTarget === this.shadowRoot.querySelector('.interactive-toggle')) {
|
|
107
129
|
// focus moved to trap-start while non-interactive - focus next focusable after this component
|
|
108
130
|
const nextFocusable = getNextFocusable(this.shadowRoot.querySelector('.interactive-trap-end'));
|
|
109
131
|
if (nextFocusable) nextFocusable.focus();
|
|
@@ -111,7 +133,7 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
|
|
|
111
133
|
// focus moved to trap-start backwards from within contents - toggle to non-interactive and apply focus
|
|
112
134
|
this._interactive = false;
|
|
113
135
|
await this.updateComplete;
|
|
114
|
-
this.shadowRoot.querySelector('.interactive-
|
|
136
|
+
this.shadowRoot.querySelector('.interactive-toggle').focus();
|
|
115
137
|
}
|
|
116
138
|
}
|
|
117
139
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.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",
|