@brightspace-ui/core 3.163.0 → 3.164.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/components/list/list-item-button-mixin.js +5 -23
- package/components/list/list-item-drag-drop-mixin.js +1 -2
- package/components/list/list-item-link-mixin.js +1 -16
- package/components/list/list-item-mixin.js +19 -40
- package/components/list/list-item-nav-mixin.js +0 -30
- package/package.json +1 -1
@@ -28,7 +28,7 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
28
28
|
[slot="outside-control-container"] {
|
29
29
|
margin: 0 -12px;
|
30
30
|
}
|
31
|
-
|
31
|
+
button {
|
32
32
|
background-color: transparent;
|
33
33
|
border: none;
|
34
34
|
color: unset;
|
@@ -45,22 +45,6 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
45
45
|
text-align: start;
|
46
46
|
width: 100%;
|
47
47
|
}
|
48
|
-
/** clean up with flag GAUD-7495-list-interactive-content */
|
49
|
-
:host(:not([_list-item-interactive-enabled])) button {
|
50
|
-
background-color: transparent;
|
51
|
-
border: none;
|
52
|
-
cursor: pointer;
|
53
|
-
display: block;
|
54
|
-
height: 100%;
|
55
|
-
outline: none;
|
56
|
-
width: 100%;
|
57
|
-
}
|
58
|
-
/** clean up with flag GAUD-7495-list-interactive-content */
|
59
|
-
:host(:not([_list-item-interactive-enabled]):not([button-disabled]):not([no-primary-action])) [slot="content"],
|
60
|
-
:host(:not([_list-item-interactive-enabled]):not([no-primary-action])) [slot="control-action"] ~ [slot="content"],
|
61
|
-
:host(:not([_list-item-interactive-enabled]):not([no-primary-action])) [slot="outside-control-action"] ~ [slot="content"] {
|
62
|
-
pointer-events: none;
|
63
|
-
}
|
64
48
|
:host(:not([button-disabled])) [slot="control-action"],
|
65
49
|
:host(:not([button-disabled])) [slot="outside-control-action"] {
|
66
50
|
grid-column-end: control-end;
|
@@ -100,8 +84,6 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
100
84
|
/** Dispatched when the item's primary button action is clicked */
|
101
85
|
this.dispatchEvent(new CustomEvent('d2l-list-item-button-click', { bubbles: true }));
|
102
86
|
|
103
|
-
if (!this._listItemInteractiveEnabled) return; // clean up with flag GAUD-7495-list-interactive-content
|
104
|
-
|
105
87
|
e.stopPropagation();
|
106
88
|
|
107
89
|
// Dispatches click event from the list item to maintain existing functionality in consumers that listen for the click event
|
@@ -121,11 +103,11 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
121
103
|
}
|
122
104
|
|
123
105
|
_renderPrimaryAction(labelledBy, content) {
|
124
|
-
return html`<button
|
125
|
-
id="${this._primaryActionId}"
|
106
|
+
return html`<button
|
107
|
+
id="${this._primaryActionId}"
|
126
108
|
aria-current="${ifDefined(this._ariaCurrent)}"
|
127
|
-
aria-labelledby="${labelledBy}"
|
128
|
-
@click="${this._onButtonClick}"
|
109
|
+
aria-labelledby="${labelledBy}"
|
110
|
+
@click="${this._onButtonClick}"
|
129
111
|
@focusin="${this._onButtonFocus}"
|
130
112
|
?disabled="${this.buttonDisabled}">
|
131
113
|
${content || nothing}
|
@@ -343,8 +343,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
343
343
|
}
|
344
344
|
:host([selected]) d2l-list-item-drag-handle,
|
345
345
|
:host([current]) d2l-list-item-drag-handle,
|
346
|
-
:host([_focusing
|
347
|
-
:host([_list-item-new-styles][_focusing]) d2l-list-item-drag-handle,
|
346
|
+
:host([_focusing]) d2l-list-item-drag-handle,
|
348
347
|
d2l-list-item-drag-handle:hover,
|
349
348
|
d2l-list-item-drag-handle.d2l-hovering,
|
350
349
|
d2l-list-item-drag-handle.d2l-focusing {
|
@@ -23,7 +23,7 @@ export const ListItemLinkMixin = superclass => class extends ListItemMixin(super
|
|
23
23
|
:host([action-href]:not([action-href=""])) {
|
24
24
|
--d2l-list-item-content-text-color: var(--d2l-color-celestine);
|
25
25
|
}
|
26
|
-
|
26
|
+
a[href] {
|
27
27
|
color: unset;
|
28
28
|
display: block;
|
29
29
|
height: 100%;
|
@@ -31,19 +31,6 @@ export const ListItemLinkMixin = superclass => class extends ListItemMixin(super
|
|
31
31
|
text-decoration: none;
|
32
32
|
width: 100%;
|
33
33
|
}
|
34
|
-
/** clean up with flag GAUD-7495-list-interactive-content */
|
35
|
-
:host(:not([_list-item-interactive-enabled])) a[href] {
|
36
|
-
display: block;
|
37
|
-
height: 100%;
|
38
|
-
outline: none;
|
39
|
-
width: 100%;
|
40
|
-
}
|
41
|
-
/** clean up with flag GAUD-7495-list-interactive-content */
|
42
|
-
:host(:not([_list-item-interactive-enabled])[action-href]:not([action-href=""])) [slot="content"],
|
43
|
-
:host(:not([_list-item-interactive-enabled]):not([no-primary-action])) [slot="control-action"] ~ [slot="content"],
|
44
|
-
:host(:not([_list-item-interactive-enabled]):not([no-primary-action])) [slot="outside-control-action"] ~ [slot="content"] {
|
45
|
-
pointer-events: none;
|
46
|
-
}
|
47
34
|
:host([action-href]:not([action-href=""])) [slot="control-action"],
|
48
35
|
:host([action-href]:not([action-href=""])) [slot="outside-control-action"] {
|
49
36
|
grid-column-end: control-end;
|
@@ -77,8 +64,6 @@ export const ListItemLinkMixin = superclass => class extends ListItemMixin(super
|
|
77
64
|
/** Dispatched when the item's primary link action is clicked */
|
78
65
|
this.dispatchEvent(new CustomEvent('d2l-list-item-link-click', { bubbles: true }));
|
79
66
|
|
80
|
-
if (!this._listItemInteractiveEnabled) return; // clean up with flag GAUD-7495-list-interactive-content
|
81
|
-
|
82
67
|
e.stopPropagation();
|
83
68
|
|
84
69
|
// Dispatches click event from the list item to maintain existing functionality in consumers that listen for the click event
|
@@ -5,13 +5,12 @@ import './list-item-generic-layout.js';
|
|
5
5
|
import './list-item-placement-marker.js';
|
6
6
|
import '../tooltip/tooltip.js';
|
7
7
|
import '../expand-collapse/expand-collapse-content.js';
|
8
|
-
import { css, html, nothing
|
8
|
+
import { css, html, nothing } from 'lit';
|
9
9
|
import { findComposedAncestor, getComposedChildren, getComposedParent } from '../../helpers/dom.js';
|
10
10
|
import { interactiveElements, isInteractiveInComposedPath } from '../../helpers/interactive.js';
|
11
11
|
import { classMap } from 'lit/directives/class-map.js';
|
12
12
|
import { composeMixins } from '../../helpers/composeMixins.js';
|
13
13
|
import { getFirstFocusableDescendant } from '../../helpers/focus.js';
|
14
|
-
import { getFlag } from '../../helpers/flags.js';
|
15
14
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
16
15
|
import { getValidHexColor } from '../../helpers/color.js';
|
17
16
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
@@ -41,13 +40,9 @@ function addTabListener() {
|
|
41
40
|
});
|
42
41
|
}
|
43
42
|
|
44
|
-
const listItemInteractiveFlag = getFlag('GAUD-7495-list-interactive-content', true);
|
45
|
-
const useNewStylesFlag = getFlag('GAUD-7495-list-item-new-styles', true);
|
46
|
-
|
47
43
|
let hasDisplayedKeyboardTooltip = false;
|
48
44
|
|
49
45
|
export function isInteractiveInListItemComposedPath(e, isPrimaryAction) {
|
50
|
-
if (!listItemInteractiveFlag) return false;
|
51
46
|
const listInteractiveElems = {
|
52
47
|
...interactiveElements,
|
53
48
|
'd2l-button': true,
|
@@ -118,8 +113,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
118
113
|
_focusingPrimaryAction: { type: Boolean, attribute: '_focusing-primary-action', reflect: true },
|
119
114
|
_highlight: { type: Boolean, reflect: true },
|
120
115
|
_highlighting: { type: Boolean, reflect: true },
|
121
|
-
_listItemInteractiveEnabled: { type: Boolean, reflect: true, attribute: '_list-item-interactive-enabled' },
|
122
|
-
_listItemNewStyles: { type: Boolean, reflect: true, attribute: '_list-item-new-styles' },
|
123
116
|
_showAddButton: { type: Boolean, attribute: '_show-add-button', reflect: true },
|
124
117
|
_siblingHasColor: { state: true },
|
125
118
|
};
|
@@ -151,15 +144,15 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
151
144
|
|
152
145
|
:host(:first-of-type) [slot="control-container"]::before,
|
153
146
|
[slot="control-container"]::after,
|
154
|
-
:host(
|
155
|
-
:host(
|
147
|
+
:host(:not([_separators="none"])[expandable][expanded]:not(:last-of-type))::after,
|
148
|
+
:host(:not([_separators="none"])[_has-nested-list]:not([expandable]):not(:last-of-type))::after {
|
156
149
|
border-top: 1px solid var(--d2l-color-mica);
|
157
150
|
content: "";
|
158
151
|
position: absolute;
|
159
152
|
width: 100%;
|
160
153
|
}
|
161
|
-
:host([
|
162
|
-
:host([
|
154
|
+
:host([draggable][expandable][expanded]:not(:last-of-type))::after,
|
155
|
+
:host([draggable][_has-nested-list]:not([expandable]):not(:last-of-type))::after {
|
163
156
|
inset-inline-start: 1.5rem; /* left and right margins of 0.3rem + drag handle width of 0.9rem */
|
164
157
|
width: calc(100% - 1.5rem);
|
165
158
|
}
|
@@ -223,22 +216,22 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
223
216
|
outline-offset: -4px;
|
224
217
|
}
|
225
218
|
@supports selector(:has(a, b)) {
|
226
|
-
:host([
|
219
|
+
:host([_focusing-primary-action]) .d2l-list-item-content {
|
227
220
|
--d2l-list-item-content-text-border-radius: initial;
|
228
221
|
--d2l-list-item-content-text-outline: initial;
|
229
222
|
--d2l-list-item-content-text-outline-offset: initial;
|
230
223
|
}
|
231
|
-
:host([
|
224
|
+
:host([_focusing-primary-action]):has(:focus-visible) .d2l-list-item-content {
|
232
225
|
--d2l-list-item-content-text-border-radius: 3px;
|
233
226
|
--d2l-list-item-content-text-outline: 2px solid var(--d2l-color-celestine);
|
234
227
|
--d2l-list-item-content-text-outline-offset: 1px;
|
235
228
|
}
|
236
|
-
:host([
|
229
|
+
:host([_focusing-primary-action]:not([padding-type="none"])) .d2l-list-item-content-none {
|
237
230
|
border-radius: initial;
|
238
231
|
outline: initial;
|
239
232
|
outline-offset: initial;
|
240
233
|
}
|
241
|
-
:host([
|
234
|
+
:host([_focusing-primary-action]:not([padding-type="none"])):has(:focus-visible) .d2l-list-item-content-none {
|
242
235
|
border-radius: 8px;
|
243
236
|
outline: var(--d2l-list-item-content-text-outline);
|
244
237
|
outline-offset: -4px;
|
@@ -331,7 +324,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
331
324
|
.d2l-list-item-content-extend-separators [slot="outside-control-container"] {
|
332
325
|
margin: 0;
|
333
326
|
}
|
334
|
-
:host([
|
327
|
+
:host([draggable]) [slot="outside-control-container"] {
|
335
328
|
margin-inline-end: -12px;
|
336
329
|
}
|
337
330
|
|
@@ -354,27 +347,17 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
354
347
|
:host([_hovering-selection]) [slot="outside-control-container"],
|
355
348
|
:host([_focusing-primary-action]) [slot="outside-control-container"],
|
356
349
|
:host(:not([selection-disabled]):not([skeleton])[selected][_hovering-selection]) [slot="outside-control-container"],
|
357
|
-
:host(:not([
|
358
|
-
:host([_list-item-new-styles]:not([selection-disabled]):not([button-disabled]):not([skeleton])[_focusing]:not([current])) [slot="outside-control-container"] {
|
359
|
-
border-color: ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')}; /* stylelint-disable-line */
|
360
|
-
margin-bottom: -1px;
|
361
|
-
}
|
362
|
-
/* clean up with GAUD-7495-list-item-new-styles flag */
|
363
|
-
:host(:not([selection-disabled]):not([button-disabled]):not([skeleton])[_focusing-elem]:not([current])) [slot="outside-control-container"] {
|
350
|
+
:host(:not([selection-disabled]):not([button-disabled]):not([skeleton])[_focusing]:not([current])) [slot="outside-control-container"] {
|
364
351
|
border-color: var(--d2l-color-mica);
|
365
352
|
margin-bottom: -1px;
|
366
353
|
}
|
367
|
-
/* clean up with GAUD-7495-list-item-new-styles flag */
|
368
|
-
:host(:not([selection-disabled]):not([skeleton])[selected]) [slot="outside-control-container"].hide-bottom-border {
|
369
|
-
background-image: linear-gradient(#f3fbff, #f3fbff), linear-gradient(to right, ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')} 20%, transparent 20%, transparent 80%, ${unsafeCSS(useNewStylesFlag ? 'var(--d2l-color-mica)' : '#b6cbe8')} 80%); /* stylelint-disable-line */
|
370
|
-
}
|
371
354
|
:host([_hovering-control]) d2l-button-add,
|
372
355
|
:host([_hovering-primary-action]) d2l-button-add,
|
373
356
|
:host([_hovering-selection]) d2l-button-add,
|
374
357
|
:host([_focusing-primary-action]) d2l-button-add,
|
375
358
|
:host(:not([selection-disabled]):not([skeleton])[selectable][_focusing]) d2l-button-add,
|
376
359
|
:host(:not([selection-disabled]):not([skeleton])[selected]) d2l-button-add {
|
377
|
-
--d2l-button-add-line-color:
|
360
|
+
--d2l-button-add-line-color: var(--d2l-color-mica);
|
378
361
|
}
|
379
362
|
:host([_hovering-control]) [slot="outside-control-container"],
|
380
363
|
:host([_hovering-primary-action]) [slot="outside-control-container"],
|
@@ -383,7 +366,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
383
366
|
}
|
384
367
|
:host(:not([selection-disabled]):not([skeleton])[selected]) [slot="outside-control-container"] {
|
385
368
|
background-color: #f3fbff;
|
386
|
-
border-color:
|
369
|
+
border-color: var(--d2l-color-mica);
|
387
370
|
margin-bottom: -1px;
|
388
371
|
}
|
389
372
|
|
@@ -474,8 +457,6 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
474
457
|
this._hasColorSlot = false;
|
475
458
|
this._hasListItemContent = true;
|
476
459
|
this._hasNestedList = false;
|
477
|
-
this._listItemInteractiveEnabled = listItemInteractiveFlag;
|
478
|
-
this._listItemNewStyles = useNewStylesFlag;
|
479
460
|
this._siblingHasColor = false;
|
480
461
|
}
|
481
462
|
|
@@ -646,9 +627,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
646
627
|
}
|
647
628
|
|
648
629
|
_onFocusIn(e) {
|
649
|
-
|
650
|
-
e.stopPropagation(); // prevent _focusing from being set on the parent
|
651
|
-
}
|
630
|
+
e.stopPropagation(); // prevent _focusing from being set on the parent
|
652
631
|
this._focusing = true;
|
653
632
|
if (this.role !== 'row' || !tabPressed || hasDisplayedKeyboardTooltip) return;
|
654
633
|
this._displayKeyboardTooltip = true;
|
@@ -725,7 +704,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
725
704
|
'd2l-list-item-content-none': !this._hasListItemContent
|
726
705
|
};
|
727
706
|
|
728
|
-
const alignNested = ((this.draggable && this.selectable) || (this.expandable && this.selectable && this.color) || (this.
|
707
|
+
const alignNested = ((this.draggable && this.selectable) || (this.expandable && this.selectable && this.color) || (this.expandable && !this.selectable)) ? 'control' : undefined;
|
729
708
|
const contentAreaContent = html`
|
730
709
|
<div slot="content"
|
731
710
|
class="${classMap(contentClasses)}"
|
@@ -737,9 +716,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
737
716
|
</div>
|
738
717
|
`;
|
739
718
|
|
740
|
-
const primaryAction = ((!this.noPrimaryAction && this._renderPrimaryAction) ? this._renderPrimaryAction(this._contentId,
|
741
|
-
const renderExpandableActionContent =
|
742
|
-
const renderCheckboxActionContent =
|
719
|
+
const primaryAction = ((!this.noPrimaryAction && this._renderPrimaryAction) ? this._renderPrimaryAction(this._contentId, contentAreaContent) : null);
|
720
|
+
const renderExpandableActionContent = !primaryAction && !this.selectable && this.expandable && !this.noPrimaryAction;
|
721
|
+
const renderCheckboxActionContent = !primaryAction && this.selectable && !this.noPrimaryAction;
|
743
722
|
|
744
723
|
let tooltipForId = null;
|
745
724
|
if (this._showAddButton) {
|
@@ -804,7 +783,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
804
783
|
@mouseleave="${this._onMouseLeavePrimaryAction}">
|
805
784
|
${primaryAction}
|
806
785
|
</div>` : nothing}
|
807
|
-
${
|
786
|
+
${(!primaryAction && !renderExpandableActionContent && !renderCheckboxActionContent) ? contentAreaContent : nothing}
|
808
787
|
<div slot="actions"
|
809
788
|
@mouseenter="${this._onMouseEnter}"
|
810
789
|
@mouseleave="${this._onMouseLeave}"
|
@@ -17,7 +17,6 @@ export const ListItemNavMixin = superclass => class extends ListItemLinkMixin(su
|
|
17
17
|
*/
|
18
18
|
preventNavigation: { type: Boolean, attribute: 'prevent-navigation' },
|
19
19
|
_childCurrent: { type: Boolean, reflect: true, attribute: '_child-current' },
|
20
|
-
_focusingElem: { type: Boolean, reflect: true, attribute: '_focusing-elem' },
|
21
20
|
_hasCurrentParent: { type: Boolean, reflect: true, attribute: '_has-current-parent' },
|
22
21
|
_nextSiblingCurrent: { type: Boolean, reflect: true, attribute: '_next-sibling-current' },
|
23
22
|
};
|
@@ -66,21 +65,6 @@ export const ListItemNavMixin = superclass => class extends ListItemLinkMixin(su
|
|
66
65
|
:host([current]) .d2l-list-item-color-outer {
|
67
66
|
padding-block: 3px;
|
68
67
|
}
|
69
|
-
|
70
|
-
/* clean up with GAUD-7495-list-item-new-styles flag */
|
71
|
-
@supports selector(:has(a, b)) {
|
72
|
-
:host([_focusing-primary-action]) .d2l-list-item-content {
|
73
|
-
--d2l-list-item-content-text-border-radius: initial;
|
74
|
-
--d2l-list-item-content-text-outline: initial;
|
75
|
-
--d2l-list-item-content-text-outline-offset: initial;
|
76
|
-
}
|
77
|
-
:host([_focusing-primary-action]):has(:focus-visible) .d2l-list-item-content {
|
78
|
-
--d2l-list-item-content-text-border-radius: 3px;
|
79
|
-
--d2l-list-item-content-text-outline: 2px solid var(--d2l-color-celestine);
|
80
|
-
--d2l-list-item-content-text-outline-offset: 1px;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
68
|
` ];
|
85
69
|
|
86
70
|
super.styles && styles.unshift(super.styles);
|
@@ -91,7 +75,6 @@ export const ListItemNavMixin = superclass => class extends ListItemLinkMixin(su
|
|
91
75
|
super();
|
92
76
|
this.current = false;
|
93
77
|
this._childCurrent = false;
|
94
|
-
this._focusingElem = false;
|
95
78
|
this._hasCurrentParent = false;
|
96
79
|
this._nextSiblingCurrent = false;
|
97
80
|
}
|
@@ -112,9 +95,6 @@ export const ListItemNavMixin = superclass => class extends ListItemLinkMixin(su
|
|
112
95
|
if (this.current) {
|
113
96
|
this.dispatchSetChildCurrentEvent(true);
|
114
97
|
}
|
115
|
-
|
116
|
-
this.addEventListener('focusin', this.#handleFocusIn);
|
117
|
-
this.addEventListener('focusout', this.#handleFocusOut);
|
118
98
|
}
|
119
99
|
|
120
100
|
updated(changedProperties) {
|
@@ -173,16 +153,6 @@ export const ListItemNavMixin = superclass => class extends ListItemLinkMixin(su
|
|
173
153
|
super._handleLinkClick(e);
|
174
154
|
}
|
175
155
|
|
176
|
-
/* clean up (including _focusingElem) with GAUD-7495-list-item-new-styles flag */
|
177
|
-
#handleFocusIn(e) {
|
178
|
-
e.stopPropagation(); // prevent _focusing from being set on the parent
|
179
|
-
this._focusingElem = true;
|
180
|
-
}
|
181
|
-
|
182
|
-
#handleFocusOut() {
|
183
|
-
this._focusingElem = false;
|
184
|
-
}
|
185
|
-
|
186
156
|
#setAriaCurrent(val) {
|
187
157
|
this._ariaCurrent = val;
|
188
158
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.164.1",
|
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",
|