@brightspace-ui/core 2.6.0 → 2.6.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/demo/list-drag-and-drop.js +1 -1
- package/components/list/list-item-drag-handle.js +2 -14
- package/components/list/list-item-generic-layout.js +0 -25
- package/components/list/list-item-mixin.js +16 -2
- package/components/tag-list/README.md +13 -8
- package/components/tag-list/tag-list.js +2 -1
- package/custom-elements.json +4 -3
- package/package.json +1 -1
- package/tools/mathjax-test-context.js +4 -0
|
@@ -167,7 +167,7 @@ class ListDemoDragAndDrop extends LitElement {
|
|
|
167
167
|
await this.updateComplete;
|
|
168
168
|
|
|
169
169
|
if (e.detail.keyboardActive) {
|
|
170
|
-
|
|
170
|
+
setTimeout(() => {
|
|
171
171
|
if (!this.shadowRoot) return;
|
|
172
172
|
const newItem = this.shadowRoot.querySelector('d2l-list').getListItemByKey(sourceListItems[0].key);
|
|
173
173
|
newItem.activateDragHandle();
|
|
@@ -262,23 +262,12 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
_onInactiveKeyDown(e) {
|
|
266
|
-
if (e.type === 'click' || e.keyCode === keyCodes.ENTER || e.keyCode === keyCodes.SPACE) {
|
|
267
|
-
e.preventDefault();
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
_onPreventDefault(e) {
|
|
272
|
-
e.preventDefault();
|
|
273
|
-
}
|
|
274
|
-
|
|
275
265
|
_renderDragger() {
|
|
276
266
|
return html`
|
|
277
267
|
<button
|
|
278
268
|
class="d2l-list-item-drag-handle-dragger-button"
|
|
279
269
|
@click="${this._onInactiveKeyboard}"
|
|
280
|
-
@
|
|
281
|
-
@keydown="${this._onInactiveKeyDown}"
|
|
270
|
+
@keydown="${this._onInactiveKeyboard}"
|
|
282
271
|
aria-label="${this._defaultLabel}"
|
|
283
272
|
?disabled="${this.disabled}">
|
|
284
273
|
<d2l-icon icon="tier1:dragger" class="d2l-button-icon"></d2l-icon>
|
|
@@ -295,8 +284,7 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
295
284
|
@focusin="${this._onFocusInKeyboardButton}"
|
|
296
285
|
@focusout="${this._onFocusOutKeyboardButton}"
|
|
297
286
|
id="${this._buttonId}"
|
|
298
|
-
@keydown="${this.
|
|
299
|
-
@keyup="${this._onActiveKeyboard}">
|
|
287
|
+
@keydown="${this._onActiveKeyboard}">
|
|
300
288
|
<d2l-icon icon="tier1:arrow-toggle-up" @click="${this._dispatchActionUp}" class="d2l-button-icon"></d2l-icon>
|
|
301
289
|
<d2l-icon icon="tier1:arrow-toggle-down" @click="${this._dispatchActionDown}" class="d2l-button-icon"></d2l-icon>
|
|
302
290
|
</button>
|
|
@@ -172,7 +172,6 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
|
172
172
|
|
|
173
173
|
firstUpdated() {
|
|
174
174
|
this.addEventListener('keydown', this._onKeydown.bind(this));
|
|
175
|
-
this.addEventListener('keyup', this._onKeyup.bind(this));
|
|
176
175
|
this.addEventListener('focusin', this._setFocusInfo.bind(this));
|
|
177
176
|
}
|
|
178
177
|
|
|
@@ -408,30 +407,6 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
|
408
407
|
}
|
|
409
408
|
|
|
410
409
|
_onKeydown(event) {
|
|
411
|
-
if (!this.gridActive) return;
|
|
412
|
-
let preventDefault = true;
|
|
413
|
-
switch (event.keyCode) {
|
|
414
|
-
case keyCodes.ENTER:
|
|
415
|
-
case keyCodes.SPACE:
|
|
416
|
-
case keyCodes.RIGHT:
|
|
417
|
-
case keyCodes.LEFT:
|
|
418
|
-
case keyCodes.UP:
|
|
419
|
-
case keyCodes.DOWN:
|
|
420
|
-
case keyCodes.HOME:
|
|
421
|
-
case keyCodes.END:
|
|
422
|
-
case keyCodes.PAGEUP:
|
|
423
|
-
case keyCodes.PAGEDOWN:
|
|
424
|
-
break;
|
|
425
|
-
default:
|
|
426
|
-
preventDefault = false;
|
|
427
|
-
}
|
|
428
|
-
if (preventDefault) {
|
|
429
|
-
event.preventDefault();
|
|
430
|
-
event.stopPropagation();
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
_onKeyup(event) {
|
|
435
410
|
if (!this.gridActive) return;
|
|
436
411
|
let node = null;
|
|
437
412
|
let preventDefault = true;
|
|
@@ -74,7 +74,9 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
74
74
|
_dropdownOpen: { type: Boolean, attribute: '_dropdown-open', reflect: true },
|
|
75
75
|
_fullscreenWithin: { type: Boolean, attribute: '_fullscreen-within', reflect: true },
|
|
76
76
|
_hovering: { type: Boolean, reflect: true },
|
|
77
|
+
_hoveringPrimaryAction: { type: Boolean, attribute: '_hovering-primary-action', reflect: true },
|
|
77
78
|
_focusing: { type: Boolean, reflect: true },
|
|
79
|
+
_focusingPrimaryAction: { type: Boolean, attribute: '_focusing-primary-action', reflect: true },
|
|
78
80
|
_highlight: { type: Boolean, reflect: true },
|
|
79
81
|
_highlighting: { type: Boolean, reflect: true },
|
|
80
82
|
_tooltipShowing: { type: Boolean, attribute: '_tooltip-showing', reflect: true }
|
|
@@ -163,8 +165,8 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
163
165
|
.d2l-list-item-content ::slotted(*) {
|
|
164
166
|
margin-top: 0.05rem;
|
|
165
167
|
}
|
|
166
|
-
:host([_hovering]) .d2l-list-item-content,
|
|
167
|
-
:host([_focusing]) .d2l-list-item-content {
|
|
168
|
+
:host([_hovering-primary-action]) .d2l-list-item-content,
|
|
169
|
+
:host([_focusing-primary-action]) .d2l-list-item-content {
|
|
168
170
|
--d2l-list-item-content-text-color: var(--d2l-color-celestine);
|
|
169
171
|
--d2l-list-item-content-text-decoration: underline;
|
|
170
172
|
}
|
|
@@ -511,11 +513,19 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
511
513
|
hasDisplayedKeyboardTooltip = true;
|
|
512
514
|
}
|
|
513
515
|
|
|
516
|
+
_onFocusInPrimaryAction() {
|
|
517
|
+
this._focusingPrimaryAction = true;
|
|
518
|
+
}
|
|
519
|
+
|
|
514
520
|
_onFocusOut() {
|
|
515
521
|
this._focusing = false;
|
|
516
522
|
this._displayKeyboardTooltip = false;
|
|
517
523
|
}
|
|
518
524
|
|
|
525
|
+
_onFocusOutPrimaryAction() {
|
|
526
|
+
this._focusingPrimaryAction = false;
|
|
527
|
+
}
|
|
528
|
+
|
|
519
529
|
_onFullscreenWithin(e) {
|
|
520
530
|
if (e.detail.state) this._fullscreenWithinCount += 1;
|
|
521
531
|
else this._fullscreenWithinCount -= 1;
|
|
@@ -527,6 +537,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
527
537
|
}
|
|
528
538
|
|
|
529
539
|
_onMouseEnterPrimaryAction() {
|
|
540
|
+
this._hoveringPrimaryAction = true;
|
|
530
541
|
this._hovering = true;
|
|
531
542
|
}
|
|
532
543
|
|
|
@@ -535,6 +546,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
535
546
|
}
|
|
536
547
|
|
|
537
548
|
_onMouseLeavePrimaryAction() {
|
|
549
|
+
this._hoveringPrimaryAction = false;
|
|
538
550
|
this._hovering = false;
|
|
539
551
|
}
|
|
540
552
|
|
|
@@ -572,6 +584,8 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
572
584
|
</div>` : nothing }
|
|
573
585
|
${primaryAction ? html`
|
|
574
586
|
<div slot="content-action"
|
|
587
|
+
@focusin="${this._onFocusInPrimaryAction}"
|
|
588
|
+
@focusout="${this._onFocusOutPrimaryAction}"
|
|
575
589
|
@mouseenter="${this._onMouseEnterPrimaryAction}"
|
|
576
590
|
@mouseleave="${this._onMouseLeavePrimaryAction}">
|
|
577
591
|
${primaryAction}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
# Tag List
|
|
3
|
-
*This component is in progress
|
|
2
|
+
*This component is in progress. The API is generally stable but the ability to clear tags is currently a WIP.*
|
|
4
3
|
|
|
5
4
|
Tag lists are used to present a list of compact, discrete pieces of information.
|
|
6
5
|
|
|
@@ -12,9 +11,14 @@ Tag lists are used to present a list of compact, discrete pieces of information.
|
|
|
12
11
|
</script>
|
|
13
12
|
|
|
14
13
|
<d2l-tag-list description="Example Tags">
|
|
15
|
-
<d2l-tag-list-item text="
|
|
16
|
-
<d2l-tag-list-item text="
|
|
17
|
-
<d2l-tag-list-item text="
|
|
14
|
+
<d2l-tag-list-item text="Lorem ipsum dolor"></d2l-tag-list-item>
|
|
15
|
+
<d2l-tag-list-item text="Reprehenderit in voluptate velit esse"></d2l-tag-list-item>
|
|
16
|
+
<d2l-tag-list-item text="Sit amet"></d2l-tag-list-item>
|
|
17
|
+
<d2l-tag-list-item text="Duis aute irure"></d2l-tag-list-item>
|
|
18
|
+
<d2l-tag-list-item text="Excepteur sint"></d2l-tag-list-item>
|
|
19
|
+
<d2l-tag-list-item text="Cillum"></d2l-tag-list-item>
|
|
20
|
+
<d2l-tag-list-item text="Saunt in culpa"></d2l-tag-list-item>
|
|
21
|
+
<d2l-tag-list-item text="Laboris nisi"></d2l-tag-list-item>
|
|
18
22
|
</d2l-tag-list>
|
|
19
23
|
```
|
|
20
24
|
|
|
@@ -30,9 +34,10 @@ The `d2l-tag-list` element can take a combination of any type of `d2l-tag-list-i
|
|
|
30
34
|
</script>
|
|
31
35
|
|
|
32
36
|
<d2l-tag-list description="Example Tags">
|
|
33
|
-
<d2l-tag-list-item text="
|
|
34
|
-
<d2l-tag-list-item text="
|
|
35
|
-
<d2l-tag-list-item text="
|
|
37
|
+
<d2l-tag-list-item text="Lorem ipsum dolor"></d2l-tag-list-item>
|
|
38
|
+
<d2l-tag-list-item text="Reprehenderit in voluptate velit esse"></d2l-tag-list-item>
|
|
39
|
+
<d2l-tag-list-item text="Sit amet"></d2l-tag-list-item>
|
|
40
|
+
<d2l-tag-list-item text="Duis aute irure"></d2l-tag-list-item>
|
|
36
41
|
</d2l-tag-list>
|
|
37
42
|
```
|
|
38
43
|
|
|
@@ -26,6 +26,7 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
|
|
|
26
26
|
*/
|
|
27
27
|
description: { type: String },
|
|
28
28
|
_chompIndex: { type: Number },
|
|
29
|
+
_lines: { type: Number },
|
|
29
30
|
_showHiddenTags: { type: Boolean }
|
|
30
31
|
};
|
|
31
32
|
}
|
|
@@ -122,7 +123,7 @@ class TagList extends LocalizeCoreElement(ArrowKeysMixin(LitElement)) {
|
|
|
122
123
|
`;
|
|
123
124
|
|
|
124
125
|
const outerContainerStyles = {
|
|
125
|
-
maxHeight: this._showHiddenTags ? undefined : `${(this._itemHeight + MARGIN_TOP_HEIGHT) * this._lines}px`
|
|
126
|
+
maxHeight: (this._showHiddenTags || !this._lines) ? undefined : `${(this._itemHeight + MARGIN_TOP_HEIGHT) * this._lines}px`
|
|
126
127
|
};
|
|
127
128
|
|
|
128
129
|
return html`
|
package/custom-elements.json
CHANGED
|
@@ -4918,7 +4918,8 @@
|
|
|
4918
4918
|
"type": "number"
|
|
4919
4919
|
},
|
|
4920
4920
|
{
|
|
4921
|
-
"name": "trailingZeroes"
|
|
4921
|
+
"name": "trailingZeroes",
|
|
4922
|
+
"type": "boolean"
|
|
4922
4923
|
},
|
|
4923
4924
|
{
|
|
4924
4925
|
"name": "value",
|
|
@@ -8322,7 +8323,7 @@
|
|
|
8322
8323
|
{
|
|
8323
8324
|
"name": "d2l-overflow-group",
|
|
8324
8325
|
"path": "./components/overflow-group/overflow-group.js",
|
|
8325
|
-
"description": "
|
|
8326
|
+
"description": "\nA 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",
|
|
8326
8327
|
"attributes": [
|
|
8327
8328
|
{
|
|
8328
8329
|
"name": "auto-show",
|
|
@@ -8449,7 +8450,7 @@
|
|
|
8449
8450
|
{
|
|
8450
8451
|
"name": "d2l-scroll-wrapper",
|
|
8451
8452
|
"path": "./components/scroll-wrapper/scroll-wrapper.js",
|
|
8452
|
-
"description": "
|
|
8453
|
+
"description": "\nWraps content which may overflow its horizontal boundaries, providing left/right scroll buttons.",
|
|
8453
8454
|
"attributes": [
|
|
8454
8455
|
{
|
|
8455
8456
|
"name": "hide-actions",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.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",
|