@brightspace-ui/core 1.235.2 → 1.236.1
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/README.md +1 -0
- package/components/button/button-mixin.js +4 -6
- package/components/card/card.js +4 -7
- package/components/filter/filter.js +4 -6
- package/components/focus-trap/focus-trap.js +4 -6
- package/components/inputs/input-checkbox.js +4 -6
- package/components/inputs/input-date-range.js +4 -6
- package/components/inputs/input-date-time-range.js +4 -6
- package/components/inputs/input-date-time.js +4 -6
- package/components/inputs/input-date.js +4 -5
- package/components/inputs/input-number.js +4 -11
- package/components/inputs/input-percent.js +4 -6
- package/components/inputs/input-search.js +4 -6
- package/components/inputs/input-text.js +4 -11
- package/components/inputs/input-textarea.js +4 -11
- package/components/inputs/input-time-range.js +4 -6
- package/components/inputs/input-time.js +4 -6
- package/components/link/link.js +4 -5
- package/components/list/list-item-mixin.js +11 -0
- package/components/overflow-group/demo/overflow-group.html +9 -11
- package/components/overflow-group/overflow-group.js +28 -28
- package/components/selection/selection-action-dropdown.js +4 -6
- package/components/selection/selection-action.js +4 -6
- package/components/selection/selection-select-all-pages.js +4 -6
- package/components/selection/selection-select-all.js +4 -6
- package/components/switch/switch-mixin.js +4 -6
- package/components/table/table-col-sort-button.js +4 -6
- package/custom-elements.json +130 -0
- package/mixins/focus-mixin.js +41 -0
- package/mixins/focus-mixin.md +24 -0
- package/package.json +1 -1
|
@@ -193,6 +193,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
193
193
|
.d2l-list-item-actions-container {
|
|
194
194
|
padding: 0.55rem 0;
|
|
195
195
|
}
|
|
196
|
+
|
|
196
197
|
::slotted([slot="actions"]),
|
|
197
198
|
.d2l-list-item-actions * {
|
|
198
199
|
display: grid;
|
|
@@ -202,6 +203,16 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
202
203
|
margin: 0.15rem 0;
|
|
203
204
|
}
|
|
204
205
|
|
|
206
|
+
.d2l-list-item-content-extend-separators ::slotted([slot="actions"]),
|
|
207
|
+
.d2l-list-item-content-extend-separators .d2l-list-item-actions * {
|
|
208
|
+
margin-right: 0.9rem;
|
|
209
|
+
}
|
|
210
|
+
:host([dir="rtl"]) .d2l-list-item-content-extend-separators ::slotted([slot="actions"]),
|
|
211
|
+
:host([dir="rtl"]) .d2l-list-item-content-extend-separators .d2l-list-item-actions * {
|
|
212
|
+
margin-left: 0.9rem;
|
|
213
|
+
margin-right: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
205
216
|
[data-breakpoint="1"] ::slotted([slot="illustration"]),
|
|
206
217
|
[data-breakpoint="1"] .d2l-list-item-illustration * {
|
|
207
218
|
margin-right: 1rem;
|
|
@@ -33,15 +33,14 @@
|
|
|
33
33
|
<d2l-button>Export</d2l-button>
|
|
34
34
|
</d2l-overflow-group>
|
|
35
35
|
</template>
|
|
36
|
-
</d2l-demo-snippet>
|
|
36
|
+
</d2l-demo-snippet>
|
|
37
37
|
|
|
38
38
|
<h2>Overflow Group (min max with autoShow)</h2>
|
|
39
39
|
<d2l-demo-snippet>
|
|
40
40
|
<template>
|
|
41
41
|
<d2l-overflow-group auto-show>
|
|
42
|
-
<d2l-button disabled primary
|
|
43
|
-
<d2l-dropdown class="d2l-button-group-show">
|
|
44
|
-
<d2l-dropdown-button text="Explore Topics" class="d2l-dropdown-opener"></d2l-dropdown-button>
|
|
42
|
+
<d2l-button disabled primary>New</d2l-button>
|
|
43
|
+
<d2l-dropdown-button text="Explore Topics" class="d2l-button-group-show">
|
|
45
44
|
<d2l-dropdown-menu id="dropdown">
|
|
46
45
|
<d2l-menu label="Astronomy">
|
|
47
46
|
<d2l-menu-item text="Introduction"></d2l-menu-item>
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
<d2l-menu-item text="The Universe"></d2l-menu-item>
|
|
53
52
|
</d2l-menu>
|
|
54
53
|
</d2l-dropdown-menu>
|
|
55
|
-
</d2l-dropdown>
|
|
54
|
+
</d2l-dropdown-button>
|
|
56
55
|
<d2l-button>Copy</d2l-button>
|
|
57
56
|
<d2l-button description="For screen readers">Import</d2l-button>
|
|
58
57
|
<d2l-button class="d2l-button-group-no-show">Delete</d2l-button>
|
|
@@ -60,18 +59,17 @@
|
|
|
60
59
|
</d2l-overflow-group>
|
|
61
60
|
</template>
|
|
62
61
|
</d2l-demo-snippet>
|
|
63
|
-
|
|
62
|
+
|
|
64
63
|
<h2>Subtle Overflow Group</h2>
|
|
65
64
|
<d2l-demo-snippet>
|
|
66
65
|
<template>
|
|
67
66
|
<d2l-overflow-group opener-style="subtle">
|
|
68
|
-
<d2l-button-subtle primary
|
|
67
|
+
<d2l-button-subtle primary text="New"></d2l-button-subtle>
|
|
69
68
|
<d2l-button-subtle text="Copy"></d2l-button-subtle>
|
|
70
69
|
<d2l-button-subtle text="Import"></d2l-button-subtle>
|
|
71
70
|
<d2l-button-subtle text="Edit"></d2l-button-subtle>
|
|
72
71
|
<d2l-button-subtle text="Manage!"></d2l-button-subtle>
|
|
73
|
-
<d2l-dropdown class="d2l-button-group-show">
|
|
74
|
-
<d2l-dropdown-button-subtle text="Explore Topics" class="d2l-dropdown-opener"></d2l-dropdown-button-subtle>
|
|
72
|
+
<d2l-dropdown-button-subtle text="Explore Topics" class="d2l-button-group-show">
|
|
75
73
|
<d2l-dropdown-menu id="dropdown">
|
|
76
74
|
<d2l-menu label="Astronomy">
|
|
77
75
|
<d2l-menu-item text="Introduction"></d2l-menu-item>
|
|
@@ -82,12 +80,12 @@
|
|
|
82
80
|
<d2l-menu-item text="The Universe"></d2l-menu-item>
|
|
83
81
|
</d2l-menu>
|
|
84
82
|
</d2l-dropdown-menu>
|
|
85
|
-
</d2l-dropdown>
|
|
83
|
+
</d2l-dropdown-button-subtle>
|
|
86
84
|
<d2l-button-subtle text="Delete"></d2l-button-subtle>
|
|
87
85
|
</d2l-overflow-group>
|
|
88
86
|
</template>
|
|
89
87
|
</d2l-demo-snippet>
|
|
90
|
-
|
|
88
|
+
|
|
91
89
|
<h2>Subtle Overflow Group (more icon)</h2>
|
|
92
90
|
<d2l-demo-snippet>
|
|
93
91
|
<template>
|
|
@@ -114,6 +114,7 @@ function convertToDropdownItem(node) {
|
|
|
114
114
|
return createMenuItemSeparator();
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
|
|
117
118
|
/**
|
|
118
119
|
*
|
|
119
120
|
* A component that can be used to display a set of buttons, links or menus that will be put into a dropdown menu when they no longer fit on the first line of their container
|
|
@@ -178,8 +179,7 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
|
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
static get styles() {
|
|
181
|
-
return [offscreenStyles,
|
|
182
|
-
css`
|
|
182
|
+
return [offscreenStyles, css`
|
|
183
183
|
:host {
|
|
184
184
|
display: block;
|
|
185
185
|
}
|
|
@@ -195,44 +195,44 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
|
|
|
195
195
|
flex-wrap: wrap;
|
|
196
196
|
justify-content: var(--d2l-overflow-group-justify-content, normal);
|
|
197
197
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
.d2l-overflow-
|
|
202
|
-
|
|
203
|
-
.d2l-overflow-group-container ::slotted(d2l-dropdown-button),
|
|
204
|
-
.d2l-overflow-group-container ::slotted(d2l-dropdown-button-subtle),
|
|
205
|
-
.d2l-overflow-group-container ::slotted(d2l-dropdown-more),
|
|
206
|
-
.d2l-overflow-group-container ::slotted(d2l-dropdown-context-menu),
|
|
207
|
-
.d2l-overflow-group-container ::slotted(d2l-selection-action),
|
|
208
|
-
.d2l-overflow-group-container ::slotted(d2l-selection-action-dropdown) {
|
|
198
|
+
::slotted(d2l-button),
|
|
199
|
+
::slotted(d2l-link),
|
|
200
|
+
::slotted(span),
|
|
201
|
+
::slotted(d2l-dropdown:not(.d2l-overflow-dropdown)),
|
|
202
|
+
::slotted(d2l-dropdown-button) {
|
|
209
203
|
margin-right: 0.6rem;
|
|
210
204
|
}
|
|
211
|
-
:host([dir="rtl"])
|
|
212
|
-
:host([dir="rtl"])
|
|
213
|
-
:host([dir="rtl"])
|
|
214
|
-
:host([dir="rtl"]) .d2l-overflow-
|
|
215
|
-
:host([dir="rtl"])
|
|
216
|
-
:host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-button),
|
|
217
|
-
:host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-button-subtle),
|
|
218
|
-
:host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-more),
|
|
219
|
-
:host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-dropdown-context-menu),
|
|
220
|
-
:host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-selection-action),
|
|
221
|
-
:host([dir="rtl"]) .d2l-overflow-group-container ::slotted(d2l-selection-action-dropdown) {
|
|
205
|
+
:host([dir="rtl"]) ::slotted(d2l-button),
|
|
206
|
+
:host([dir="rtl"]) ::slotted(d2l-link),
|
|
207
|
+
:host([dir="rtl"]) ::slotted(span),
|
|
208
|
+
:host([dir="rtl"]) ::slotted(d2l-dropdown:not(.d2l-overflow-dropdown)),
|
|
209
|
+
:host([dir="rtl"]) ::slotted(d2l-dropdown-button) {
|
|
222
210
|
margin-left: 0.6rem;
|
|
223
211
|
margin-right: 0;
|
|
224
212
|
}
|
|
225
|
-
|
|
213
|
+
::slotted(d2l-button-subtle),
|
|
214
|
+
::slotted(d2l-button-icon),
|
|
215
|
+
::slotted(d2l-dropdown-button-subtle),
|
|
216
|
+
::slotted(d2l-dropdown-more),
|
|
217
|
+
::slotted(d2l-dropdown-context-menu),
|
|
218
|
+
::slotted(d2l-selection-action),
|
|
219
|
+
::slotted(d2l-selection-action-dropdown) {
|
|
226
220
|
margin-right: 0.2rem;
|
|
227
221
|
}
|
|
228
|
-
:host([
|
|
222
|
+
:host([dir="rtl"]) ::slotted(d2l-button-subtle),
|
|
223
|
+
:host([dir="rtl"]) ::slotted(d2l-button-icon),
|
|
224
|
+
:host([dir="rtl"]) ::slotted(d2l-dropdown-button-subtle),
|
|
225
|
+
:host([dir="rtl"]) ::slotted(d2l-dropdown-more),
|
|
226
|
+
:host([dir="rtl"]) ::slotted(d2l-dropdown-context-menu),
|
|
227
|
+
:host([dir="rtl"]) ::slotted(d2l-selection-action),
|
|
228
|
+
:host([dir="rtl"]) ::slotted(d2l-selection-action-dropdown) {
|
|
229
229
|
margin-left: 0.2rem;
|
|
230
230
|
margin-right: 0;
|
|
231
231
|
}
|
|
232
232
|
.d2l-overflow-group-container ::slotted([data-is-chomped]) {
|
|
233
233
|
display: none !important;
|
|
234
|
-
}
|
|
235
|
-
];
|
|
234
|
+
}
|
|
235
|
+
`];
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
constructor() {
|
|
@@ -2,6 +2,7 @@ import '../button/button-subtle.js';
|
|
|
2
2
|
import { html, LitElement } from 'lit-element/lit-element.js';
|
|
3
3
|
import { DropdownOpenerMixin } from '../dropdown/dropdown-opener-mixin.js';
|
|
4
4
|
import { dropdownOpenerStyles } from '../dropdown/dropdown-opener-styles.js';
|
|
5
|
+
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
6
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
6
7
|
import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
|
|
7
8
|
import { SelectionActionMixin } from './selection-action-mixin.js';
|
|
@@ -11,7 +12,7 @@ import { SelectionActionMixin } from './selection-action-mixin.js';
|
|
|
11
12
|
* @slot - Dropdown content (e.g., "d2l-dropdown-content", "d2l-dropdown-menu" or "d2l-dropdown-tabs")
|
|
12
13
|
* @fires d2l-selection-observer-subscribe - Internal event
|
|
13
14
|
*/
|
|
14
|
-
class ActionDropdown extends LocalizeCoreElement(SelectionActionMixin(DropdownOpenerMixin(LitElement))) {
|
|
15
|
+
class ActionDropdown extends FocusMixin(LocalizeCoreElement(SelectionActionMixin(DropdownOpenerMixin(LitElement)))) {
|
|
15
16
|
|
|
16
17
|
static get properties() {
|
|
17
18
|
return {
|
|
@@ -27,6 +28,8 @@ class ActionDropdown extends LocalizeCoreElement(SelectionActionMixin(DropdownOp
|
|
|
27
28
|
return dropdownOpenerStyles;
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
static focusElementSelector = 'd2l-button-subtle';
|
|
32
|
+
|
|
30
33
|
render() {
|
|
31
34
|
return html`
|
|
32
35
|
<d2l-button-subtle
|
|
@@ -39,11 +42,6 @@ class ActionDropdown extends LocalizeCoreElement(SelectionActionMixin(DropdownOp
|
|
|
39
42
|
`;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
focus() {
|
|
43
|
-
const elem = this.shadowRoot && this.shadowRoot.querySelector('d2l-button-subtle');
|
|
44
|
-
if (elem) elem.focus();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
45
|
/**
|
|
48
46
|
* Gets the opener element with class "d2l-dropdown-opener" (required by dropdown-opener-mixin).
|
|
49
47
|
* @return {HTMLElement}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '../button/button-subtle.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit-element/lit-element.js';
|
|
3
3
|
import { ButtonMixin } from '../button/button-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
5
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
5
6
|
import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
|
|
6
7
|
import { SelectionActionMixin } from './selection-action-mixin.js';
|
|
@@ -11,7 +12,7 @@ import { SelectionInfo } from './selection-mixin.js';
|
|
|
11
12
|
* @fires d2l-selection-action-click - Dispatched when the user clicks the action button. The `SelectionInfo` is provided as the event `detail`. If `requires-selection` was specified then the event will only be dispatched if items are selected.
|
|
12
13
|
* @fires d2l-selection-observer-subscribe - Internal event
|
|
13
14
|
*/
|
|
14
|
-
class Action extends LocalizeCoreElement(SelectionActionMixin(ButtonMixin(LitElement))) {
|
|
15
|
+
class Action extends FocusMixin(LocalizeCoreElement(SelectionActionMixin(ButtonMixin(LitElement)))) {
|
|
15
16
|
|
|
16
17
|
static get properties() {
|
|
17
18
|
return {
|
|
@@ -39,6 +40,8 @@ class Action extends LocalizeCoreElement(SelectionActionMixin(ButtonMixin(LitEle
|
|
|
39
40
|
`;
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
static focusElementSelector = 'd2l-button-subtle';
|
|
44
|
+
|
|
42
45
|
connectedCallback() {
|
|
43
46
|
super.connectedCallback();
|
|
44
47
|
this.addEventListener('d2l-button-ghost-click', this._handleActionClick);
|
|
@@ -61,11 +64,6 @@ class Action extends LocalizeCoreElement(SelectionActionMixin(ButtonMixin(LitEle
|
|
|
61
64
|
`;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
focus() {
|
|
65
|
-
const elem = this.shadowRoot && this.shadowRoot.querySelector('d2l-button-subtle');
|
|
66
|
-
if (elem) elem.focus();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
67
|
_handleActionClick(e) {
|
|
70
68
|
e.stopPropagation();
|
|
71
69
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../button/button-subtle.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit-element/lit-element.js';
|
|
3
|
+
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
3
4
|
import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
|
|
4
5
|
import { SelectionInfo } from './selection-mixin.js';
|
|
5
6
|
import { SelectionObserverMixin } from './selection-observer-mixin.js';
|
|
@@ -8,7 +9,7 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
|
|
|
8
9
|
* A subtle button that selects all items for all pages.
|
|
9
10
|
* @fires d2l-selection-observer-subscribe - Internal event
|
|
10
11
|
*/
|
|
11
|
-
class SelectAllPages extends LocalizeCoreElement(SelectionObserverMixin(LitElement)) {
|
|
12
|
+
class SelectAllPages extends FocusMixin(LocalizeCoreElement(SelectionObserverMixin(LitElement))) {
|
|
12
13
|
|
|
13
14
|
static get styles() {
|
|
14
15
|
return css`
|
|
@@ -21,6 +22,8 @@ class SelectAllPages extends LocalizeCoreElement(SelectionObserverMixin(LitEleme
|
|
|
21
22
|
`;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
static focusElementSelector = 'd2l-button-subtle';
|
|
26
|
+
|
|
24
27
|
render() {
|
|
25
28
|
if (!this._provider) return;
|
|
26
29
|
if (!this._provider.itemCount) return;
|
|
@@ -34,11 +37,6 @@ class SelectAllPages extends LocalizeCoreElement(SelectionObserverMixin(LitEleme
|
|
|
34
37
|
</d2l-button-subtle>`;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
focus() {
|
|
38
|
-
const elem = this.shadowRoot && this.shadowRoot.querySelector('d2l-button-subtle');
|
|
39
|
-
if (elem) elem.focus();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
40
|
_handleClick() {
|
|
43
41
|
if (this._provider) this._provider.setSelectionForAll(true, true);
|
|
44
42
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../inputs/input-checkbox.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit-element/lit-element.js';
|
|
3
|
+
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
3
4
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
4
5
|
import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
|
|
5
6
|
import { SelectionInfo } from './selection-mixin.js';
|
|
@@ -9,7 +10,7 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
|
|
|
9
10
|
* A checkbox that provides select-all behavior for selection components such as tables and lists.
|
|
10
11
|
* @fires d2l-selection-observer-subscribe - Internal event
|
|
11
12
|
*/
|
|
12
|
-
class SelectAll extends LocalizeCoreElement(SelectionObserverMixin(LitElement)) {
|
|
13
|
+
class SelectAll extends FocusMixin(LocalizeCoreElement(SelectionObserverMixin(LitElement))) {
|
|
13
14
|
|
|
14
15
|
static get properties() {
|
|
15
16
|
return {
|
|
@@ -33,6 +34,8 @@ class SelectAll extends LocalizeCoreElement(SelectionObserverMixin(LitElement))
|
|
|
33
34
|
`;
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
static focusElementSelector = 'd2l-input-checkbox';
|
|
38
|
+
|
|
36
39
|
constructor() {
|
|
37
40
|
super();
|
|
38
41
|
this.disabled = false;
|
|
@@ -56,11 +59,6 @@ class SelectAll extends LocalizeCoreElement(SelectionObserverMixin(LitElement))
|
|
|
56
59
|
`;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
focus() {
|
|
60
|
-
const elem = this.shadowRoot && this.shadowRoot.querySelector('d2l-input-checkbox');
|
|
61
|
-
if (elem) elem.focus();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
62
|
_handleCheckboxChange(e) {
|
|
65
63
|
if (this._provider) this._provider.setSelectionForAll(e.target.checked, false);
|
|
66
64
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import '../tooltip/tooltip.js';
|
|
3
3
|
import { css, html } from 'lit-element/lit-element.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
5
|
import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
|
|
5
6
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
6
7
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
7
8
|
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
9
|
|
|
9
|
-
export const SwitchMixin = superclass => class extends RtlMixin(FocusVisiblePolyfillMixin(superclass)) {
|
|
10
|
+
export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(FocusVisiblePolyfillMixin(superclass))) {
|
|
10
11
|
|
|
11
12
|
static get properties() {
|
|
12
13
|
return {
|
|
@@ -165,6 +166,8 @@ export const SwitchMixin = superclass => class extends RtlMixin(FocusVisiblePoly
|
|
|
165
166
|
`;
|
|
166
167
|
}
|
|
167
168
|
|
|
169
|
+
static focusElementSelector = '.d2l-switch-container';
|
|
170
|
+
|
|
168
171
|
constructor() {
|
|
169
172
|
super();
|
|
170
173
|
this.disabled = false;
|
|
@@ -212,11 +215,6 @@ export const SwitchMixin = superclass => class extends RtlMixin(FocusVisiblePoly
|
|
|
212
215
|
`;
|
|
213
216
|
}
|
|
214
217
|
|
|
215
|
-
focus() {
|
|
216
|
-
const elem = this.shadowRoot && this.shadowRoot.querySelector('.d2l-switch-container');
|
|
217
|
-
if (elem) elem.focus();
|
|
218
|
-
}
|
|
219
|
-
|
|
220
218
|
_handleClick() {
|
|
221
219
|
this._toggleState();
|
|
222
220
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import '../icons/icon.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit-element/lit-element.js';
|
|
3
|
+
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Button for sorting a table column in ascending/descending order.
|
|
6
7
|
* @slot - Text of the sort button
|
|
7
8
|
*/
|
|
8
|
-
export class TableColSortButton extends LitElement {
|
|
9
|
+
export class TableColSortButton extends FocusMixin(LitElement) {
|
|
9
10
|
|
|
10
11
|
static get properties() {
|
|
11
12
|
return {
|
|
@@ -57,6 +58,8 @@ export class TableColSortButton extends LitElement {
|
|
|
57
58
|
`;
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
static focusElementSelector = 'button';
|
|
62
|
+
|
|
60
63
|
constructor() {
|
|
61
64
|
super();
|
|
62
65
|
this.nosort = false;
|
|
@@ -70,11 +73,6 @@ export class TableColSortButton extends LitElement {
|
|
|
70
73
|
return html`<button type="button"><slot></slot>${iconView}</button>`;
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
focus() {
|
|
74
|
-
const button = this.shadowRoot && this.shadowRoot.querySelector('button');
|
|
75
|
-
if (button) button.focus();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
customElements.define('d2l-table-col-sort-button', TableColSortButton);
|