@brightspace-ui/core 3.156.1 → 3.156.3
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/list/list-item-drag-handle.js +5 -4
- package/components/list/list-item-drag-image.js +3 -8
- package/components/list/list-item-generic-layout.js +11 -8
- package/components/list/list-item-mixin.js +8 -30
- package/components/list/list-item-placement-marker.js +3 -16
- package/components/scroll-wrapper/demo/scroll-wrapper-test.js +1 -2
- package/components/table/demo/table-test.js +1 -2
- package/helpers/demo/prism.html +2 -4
- package/package.json +1 -1
@@ -7,7 +7,6 @@ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
7
7
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
8
8
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
9
9
|
import { moveActions } from '../button/button-move.js';
|
10
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
11
10
|
|
12
11
|
const keyCodes = Object.freeze({
|
13
12
|
DOWN: 40,
|
@@ -43,7 +42,7 @@ let hasDisplayedKeyboardTooltip = false;
|
|
43
42
|
/**
|
44
43
|
* @fires d2l-list-item-drag-handle-action - Dispatched when an action performed on the drag handle
|
45
44
|
*/
|
46
|
-
class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(
|
45
|
+
class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(LitElement)) {
|
47
46
|
|
48
47
|
static get properties() {
|
49
48
|
return {
|
@@ -186,6 +185,8 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
186
185
|
|
187
186
|
async _onMoveButtonAction(e) {
|
188
187
|
|
188
|
+
const isRtl = document.documentElement.getAttribute('dir') === 'rtl';
|
189
|
+
|
189
190
|
let action = null;
|
190
191
|
switch (e.detail.action) {
|
191
192
|
case moveActions.up:
|
@@ -199,11 +200,11 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
199
200
|
break;
|
200
201
|
case moveActions.right:
|
201
202
|
this._movingElement = true;
|
202
|
-
action = (
|
203
|
+
action = (isRtl ? dragActions.unnest : dragActions.nest);
|
203
204
|
break;
|
204
205
|
case moveActions.left:
|
205
206
|
this._movingElement = true;
|
206
|
-
action = (
|
207
|
+
action = (isRtl ? dragActions.nest : dragActions.unnest) ;
|
207
208
|
break;
|
208
209
|
case moveActions.rootHome:
|
209
210
|
this._movingElement = true;
|
@@ -4,10 +4,9 @@ import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { bodySmallStyles } from '../typography/styles.js';
|
5
5
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
6
6
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
7
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
8
7
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
9
8
|
|
10
|
-
class ListItemDragImage extends LocalizeCoreElement(SkeletonMixin(
|
9
|
+
class ListItemDragImage extends LocalizeCoreElement(SkeletonMixin(LitElement)) {
|
11
10
|
|
12
11
|
static get properties() {
|
13
12
|
return {
|
@@ -24,7 +23,7 @@ class ListItemDragImage extends LocalizeCoreElement(SkeletonMixin(RtlMixin(LitEl
|
|
24
23
|
:host {
|
25
24
|
display: block;
|
26
25
|
height: 70px;
|
27
|
-
|
26
|
+
inset-inline-start: -10000px;
|
28
27
|
position: absolute;
|
29
28
|
width: 340px;
|
30
29
|
z-index: 0;
|
@@ -32,10 +31,6 @@ class ListItemDragImage extends LocalizeCoreElement(SkeletonMixin(RtlMixin(LitEl
|
|
32
31
|
:host([hidden]) {
|
33
32
|
display: none;
|
34
33
|
}
|
35
|
-
:host([dir="rtl"]) {
|
36
|
-
left: 0;
|
37
|
-
right: -10000px;
|
38
|
-
}
|
39
34
|
.first, .second, .third {
|
40
35
|
background-color: white;
|
41
36
|
border: 1px solid var(--d2l-color-mica);
|
@@ -90,7 +85,7 @@ class ListItemDragImage extends LocalizeCoreElement(SkeletonMixin(RtlMixin(LitEl
|
|
90
85
|
top: 30px;
|
91
86
|
z-index: 998; /* must be higher than the skeleton z-index */
|
92
87
|
}
|
93
|
-
:
|
88
|
+
.count:dir(rtl) {
|
94
89
|
left: 14px;
|
95
90
|
}
|
96
91
|
`];
|
@@ -3,7 +3,6 @@ import { findComposedAncestor, isComposedAncestor } from '../../helpers/dom.js';
|
|
3
3
|
import { getComposedActiveElement, getFirstFocusableDescendant, getFocusableDescendants, getLastFocusableDescendant, getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
|
4
4
|
import { getFlag } from '../../helpers/flags.js';
|
5
5
|
import { isInteractiveDescendant } from '../../mixins/interactive/interactive-mixin.js';
|
6
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
7
6
|
|
8
7
|
const keyCodes = {
|
9
8
|
DOWN: 40,
|
@@ -20,6 +19,10 @@ const keyCodes = {
|
|
20
19
|
|
21
20
|
const listItemUpButtonFixFlag = getFlag('GAUD-8229-list-up-button-fix', true);
|
22
21
|
|
22
|
+
function isRtl() {
|
23
|
+
return document.documentElement.getAttribute('dir') === 'rtl';
|
24
|
+
}
|
25
|
+
|
23
26
|
/**
|
24
27
|
* A component for generating a list item's layout with forced focus ordering and grid support.
|
25
28
|
* Focusable items placed in the "content" slot will have their focus removed; use the content-action
|
@@ -33,7 +36,7 @@ const listItemUpButtonFixFlag = getFlag('GAUD-8229-list-up-button-fix', true);
|
|
33
36
|
* @slot actions - Other actions for the list item on the far right, such as a context menu
|
34
37
|
* @slot nested - Optional `d2l-list` for creating nested lists
|
35
38
|
*/
|
36
|
-
class ListItemGenericLayout extends
|
39
|
+
class ListItemGenericLayout extends LitElement {
|
37
40
|
|
38
41
|
static get properties() {
|
39
42
|
return {
|
@@ -289,7 +292,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
289
292
|
_focusFirstRow() {
|
290
293
|
const list = findComposedAncestor(this, (node) => node.tagName === 'D2L-LIST');
|
291
294
|
const row = list.firstElementChild.shadowRoot.querySelector('[role="gridcell"]');
|
292
|
-
if (
|
295
|
+
if (isRtl()) {
|
293
296
|
row._focusLastCell();
|
294
297
|
} else {
|
295
298
|
row._focusFirstCell();
|
@@ -312,7 +315,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
312
315
|
_focusLastRow() {
|
313
316
|
const list = findComposedAncestor(this, (node) => node.tagName === 'D2L-LIST');
|
314
317
|
const row = list.lastElementChild.shadowRoot.querySelector('[role="gridcell"]');
|
315
|
-
if (
|
318
|
+
if (isRtl()) {
|
316
319
|
row._focusFirstCell();
|
317
320
|
} else {
|
318
321
|
row._focusLastCell();
|
@@ -485,14 +488,14 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
485
488
|
|
486
489
|
switch (e.keyCode) {
|
487
490
|
case keyCodes.RIGHT:
|
488
|
-
if (
|
491
|
+
if (isRtl()) {
|
489
492
|
this._focusPreviousWithinRow(focusInfo, focusables);
|
490
493
|
} else {
|
491
494
|
this._focusNextWithinRow(focusInfo, focusables);
|
492
495
|
}
|
493
496
|
break;
|
494
497
|
case keyCodes.LEFT:
|
495
|
-
if (
|
498
|
+
if (isRtl()) {
|
496
499
|
this._focusNextWithinRow(focusInfo, focusables);
|
497
500
|
} else {
|
498
501
|
this._focusPreviousWithinRow(focusInfo, focusables);
|
@@ -507,7 +510,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
507
510
|
this._focusNextRow(focusInfo);
|
508
511
|
break;
|
509
512
|
case keyCodes.HOME:
|
510
|
-
if (
|
513
|
+
if (isRtl()) {
|
511
514
|
if (e.ctrlKey) {
|
512
515
|
this._focusFirstRow();
|
513
516
|
} else {
|
@@ -525,7 +528,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
525
528
|
}
|
526
529
|
break;
|
527
530
|
case keyCodes.END:
|
528
|
-
if (
|
531
|
+
if (isRtl()) {
|
529
532
|
if (e.ctrlKey) {
|
530
533
|
// focus first item of last row
|
531
534
|
this._focusLastRow();
|
@@ -247,11 +247,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
247
247
|
[slot="content"] {
|
248
248
|
display: flex;
|
249
249
|
justify-content: start;
|
250
|
-
padding: 0.55rem
|
251
|
-
|
252
|
-
:host([dir="rtl"]) [slot="content"] {
|
253
|
-
padding-left: 0.55rem;
|
254
|
-
padding-right: 0;
|
250
|
+
padding-block: 0.55rem;
|
251
|
+
padding-inline: 0 0.55rem;
|
255
252
|
}
|
256
253
|
:host([padding-type="none"]) [slot="content"] {
|
257
254
|
padding-bottom: 0;
|
@@ -292,12 +289,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
292
289
|
|
293
290
|
.d2l-list-item-content-extend-separators ::slotted([slot="actions"]),
|
294
291
|
.d2l-list-item-content-extend-separators .d2l-list-item-actions > * {
|
295
|
-
margin-
|
296
|
-
}
|
297
|
-
:host([dir="rtl"]) .d2l-list-item-content-extend-separators ::slotted([slot="actions"]),
|
298
|
-
:host([dir="rtl"]) .d2l-list-item-content-extend-separators .d2l-list-item-actions > * {
|
299
|
-
margin-left: 0.9rem;
|
300
|
-
margin-right: 0;
|
292
|
+
margin-inline-end: 0.9rem;
|
301
293
|
}
|
302
294
|
|
303
295
|
d2l-selection-input {
|
@@ -453,31 +445,17 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
453
445
|
width: var(--d2l-list-item-color-width, 6px);
|
454
446
|
}
|
455
447
|
.d2l-list-item-color-outer {
|
456
|
-
padding: 2px
|
457
|
-
|
458
|
-
:host([dir="rtl"]) .d2l-list-item-color-outer {
|
459
|
-
padding-left: 12px;
|
460
|
-
padding-right: 0;
|
448
|
+
padding-block: 2px 1px;
|
449
|
+
padding-inline: 0 12px;
|
461
450
|
}
|
462
451
|
:host(:not([_nested])) .d2l-list-item-content-extend-separators .d2l-list-item-color-outer {
|
463
|
-
padding-
|
464
|
-
}
|
465
|
-
:host(:not([_nested])[dir="rtl"]) .d2l-list-item-content-extend-separators .d2l-list-item-color-outer {
|
466
|
-
padding-left: 12px;
|
467
|
-
padding-right: 3px;
|
452
|
+
padding-inline-start: 3px;
|
468
453
|
}
|
469
454
|
:host([selectable]:not([_render-expand-collapse-slot])) .d2l-list-item-content-extend-separators .d2l-list-item-color-outer {
|
470
|
-
padding-
|
471
|
-
}
|
472
|
-
:host([selectable]:not([_render-expand-collapse-slot])[dir="rtl"]) .d2l-list-item-content-extend-separators .d2l-list-item-color-outer {
|
473
|
-
padding-left: 0;
|
455
|
+
padding-inline-end: 0;
|
474
456
|
}
|
475
457
|
.d2l-list-item-color-outer + .d2l-list-expand-collapse {
|
476
|
-
margin-
|
477
|
-
}
|
478
|
-
:host([dir="rtl"]) .d2l-list-item-color-outer + .d2l-list-expand-collapse {
|
479
|
-
margin-left: 0;
|
480
|
-
margin-right: -6px;
|
458
|
+
margin-inline-start: -6px;
|
481
459
|
}
|
482
460
|
|
483
461
|
[slot="add"],
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import '../colors/colors.js';
|
2
2
|
import { css, html, LitElement } from 'lit';
|
3
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
4
3
|
|
5
|
-
class ListItemPlacementMarker extends
|
4
|
+
class ListItemPlacementMarker extends LitElement {
|
6
5
|
|
7
6
|
static get styles() {
|
8
7
|
return css`
|
@@ -26,32 +25,20 @@ class ListItemPlacementMarker extends RtlMixin(LitElement) {
|
|
26
25
|
.d2l-list-drag-marker-linecap {
|
27
26
|
fill: var(--d2l-color-celestine);
|
28
27
|
height: 12px;
|
29
|
-
margin-
|
30
|
-
margin-right: 0;
|
28
|
+
margin-inline: -1px 0;
|
31
29
|
stroke: none;
|
32
30
|
width: 4px;
|
33
31
|
}
|
34
32
|
|
35
|
-
:host([dir="rtl"]) .d2l-list-drag-marker-linecap {
|
36
|
-
margin-left: 0;
|
37
|
-
margin-right: -1px;
|
38
|
-
}
|
39
|
-
|
40
33
|
.d2l-list-drag-marker-circle {
|
41
34
|
fill: none;
|
42
35
|
height: 12px;
|
43
|
-
margin-
|
44
|
-
margin-right: -1px;
|
36
|
+
margin-inline: 0 -1px;
|
45
37
|
stroke: var(--d2l-color-celestine);
|
46
38
|
stroke-width: 3px;
|
47
39
|
width: 12px;
|
48
40
|
}
|
49
41
|
|
50
|
-
:host([dir="rtl"]) .d2l-list-drag-marker-circle {
|
51
|
-
margin-left: -1px;
|
52
|
-
margin-right: 0;
|
53
|
-
}
|
54
|
-
|
55
42
|
.d2l-list-drag-marker {
|
56
43
|
display: flex;
|
57
44
|
flex-wrap: nowrap;
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import '../scroll-wrapper.js';
|
2
2
|
import { css, html, LitElement } from 'lit';
|
3
|
-
import { RtlMixin } from '../../../mixins/rtl/rtl-mixin.js';
|
4
3
|
import { styleMap } from 'lit/directives/style-map.js';
|
5
4
|
|
6
|
-
class TestScrollWrapper extends
|
5
|
+
class TestScrollWrapper extends LitElement {
|
7
6
|
|
8
7
|
static get properties() {
|
9
8
|
return {
|
@@ -19,7 +19,6 @@ import { css, html, nothing } from 'lit';
|
|
19
19
|
import { tableStyles, TableWrapper } from '../table-wrapper.js';
|
20
20
|
import { DemoPassthroughMixin } from '../../demo/demo-passthrough-mixin.js';
|
21
21
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
22
|
-
import { RtlMixin } from '../../../mixins/rtl/rtl-mixin.js';
|
23
22
|
|
24
23
|
const columns = ['Population', 'Size', 'Elevation'];
|
25
24
|
const thText = ['Additional', 'Placeholder', 'Header', 'Row', 'Cells'];
|
@@ -36,7 +35,7 @@ const data = () => [
|
|
36
35
|
|
37
36
|
const formatter = new Intl.NumberFormat('en-US');
|
38
37
|
|
39
|
-
class TestTable extends
|
38
|
+
class TestTable extends DemoPassthroughMixin(TableWrapper, 'd2l-table-wrapper') {
|
40
39
|
|
41
40
|
static get properties() {
|
42
41
|
return {
|
package/helpers/demo/prism.html
CHANGED
@@ -615,7 +615,6 @@ import { getComposedActiveElement, getFirstFocusableDescendant, getPreviousFocus
|
|
615
615
|
import { classMap } from 'lit/directives/class-map.js';
|
616
616
|
import { html } from 'lit';
|
617
617
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
618
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
619
618
|
import { styleMap } from 'lit/directives/style-map.js';
|
620
619
|
import { tryGetIfrauBackdropService } from '../../helpers/ifrauBackdropService.js';
|
621
620
|
|
@@ -625,7 +624,7 @@ const minBackdropWidthMobile = 30;
|
|
625
624
|
const outerMarginTopBottom = 18;
|
626
625
|
const defaultVerticalOffset = 16;
|
627
626
|
|
628
|
-
export const DropdownContentMixin = superclass => class extends LocalizeCoreElement(
|
627
|
+
export const DropdownContentMixin = superclass => class extends LocalizeCoreElement(superclass) {
|
629
628
|
|
630
629
|
static get properties() {
|
631
630
|
return {
|
@@ -1772,7 +1771,6 @@ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
1772
1771
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
1773
1772
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
1774
1773
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
1775
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
1776
1774
|
import { styleMap } from 'lit/directives/style-map.js';
|
1777
1775
|
|
1778
1776
|
/**
|
@@ -1783,7 +1781,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
1783
1781
|
* @slot footer - Slot for footer content, such secondary actions
|
1784
1782
|
* @slot header - Slot for header content, such as course image (no actionable elements)
|
1785
1783
|
*/
|
1786
|
-
class Card extends FocusMixin(
|
1784
|
+
class Card extends FocusMixin(LitElement) {
|
1787
1785
|
|
1788
1786
|
static get properties() {
|
1789
1787
|
return {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.156.
|
3
|
+
"version": "3.156.3",
|
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",
|