@brightspace-ui/core 2.86.3 → 2.86.4
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.
|
@@ -20,38 +20,12 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
|
20
20
|
:host(:not([button-disabled])) {
|
|
21
21
|
--d2l-list-item-content-text-color: var(--d2l-color-celestine);
|
|
22
22
|
}
|
|
23
|
-
:host([button-disabled][
|
|
24
|
-
|
|
25
|
-
--d2l-list-item-content-text-color: unset;
|
|
26
|
-
--d2l-list-item-content-text-decoration: none;
|
|
27
|
-
}
|
|
28
|
-
:host([button-disabled]) button {
|
|
29
|
-
cursor: default;
|
|
23
|
+
:host([button-disabled]) [slot="content-action"] {
|
|
24
|
+
pointer-events: none;
|
|
30
25
|
}
|
|
31
26
|
[slot="outside-control-container"] {
|
|
32
27
|
margin: 0 -12px;
|
|
33
28
|
}
|
|
34
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_hovering]) [slot="control-container"]::before,
|
|
35
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_hovering]) [slot="control-container"]::after,
|
|
36
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_focusing]) [slot="control-container"]::before,
|
|
37
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_focusing]) [slot="control-container"]::after,
|
|
38
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_hovering]) [slot="control-container"]::before,
|
|
39
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_hovering]) [slot="control-container"]::after,
|
|
40
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_focusing]) [slot="control-container"]::before,
|
|
41
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_focusing]) [slot="control-container"]::after {
|
|
42
|
-
border-top-color: transparent;
|
|
43
|
-
}
|
|
44
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_hovering]) [slot="outside-control-container"],
|
|
45
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_focusing]) [slot="outside-control-container"],
|
|
46
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_hovering]) [slot="outside-control-container"],
|
|
47
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_focusing]) [slot="outside-control-container"] {
|
|
48
|
-
background-color: white;
|
|
49
|
-
border-color: #b6cbe8; /* celestine alpha 0.3 */
|
|
50
|
-
}
|
|
51
|
-
:host([selectable]:not([selection-disabled][button-disabled]):not([skeleton])[_hovering]) [slot="outside-control-container"],
|
|
52
|
-
:host(:not([selectable]):not([button-disabled]):not([skeleton])[_hovering]) [slot="outside-control-container"] {
|
|
53
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
54
|
-
}
|
|
55
29
|
button {
|
|
56
30
|
background-color: transparent;
|
|
57
31
|
border: none;
|
|
@@ -61,11 +35,6 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
|
61
35
|
outline: none;
|
|
62
36
|
width: 100%;
|
|
63
37
|
}
|
|
64
|
-
/* simply hide the button action layer rather than disabling button so
|
|
65
|
-
that the cursor pointer ins't displayed when hovering skeleton */
|
|
66
|
-
:host([skeleton]) button {
|
|
67
|
-
display: none;
|
|
68
|
-
}
|
|
69
38
|
` ];
|
|
70
39
|
|
|
71
40
|
super.styles && styles.unshift(super.styles);
|
|
@@ -78,6 +47,11 @@ export const ListItemButtonMixin = superclass => class extends ListItemMixin(sup
|
|
|
78
47
|
this.buttonDisabled = false;
|
|
79
48
|
}
|
|
80
49
|
|
|
50
|
+
willUpdate(changedProperties) {
|
|
51
|
+
super.willUpdate(changedProperties);
|
|
52
|
+
if (changedProperties.has('buttonDisabled') && this.buttonDisabled === true) this._hoveringPrimaryAction = false;
|
|
53
|
+
}
|
|
54
|
+
|
|
81
55
|
_onButtonClick() {
|
|
82
56
|
/** Dispatched when the item's primary button action is clicked */
|
|
83
57
|
this.dispatchEvent(new CustomEvent('d2l-list-item-button-click', { bubbles: true }));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import '../selection/selection-input.js';
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
4
3
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
5
4
|
import { SelectionInfo } from '../selection/selection-mixin.js';
|
|
6
5
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
@@ -33,7 +32,8 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
|
|
|
33
32
|
* Private. The selection info (set by the selection component).
|
|
34
33
|
* @ignore
|
|
35
34
|
*/
|
|
36
|
-
selectionInfo: { type: Object, attribute: false }
|
|
35
|
+
selectionInfo: { type: Object, attribute: false },
|
|
36
|
+
_hoveringSelection: { type: Boolean, attribute: '_hovering-selection', reflect: true }
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -44,7 +44,7 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
|
|
|
44
44
|
display: block;
|
|
45
45
|
height: 100%;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
:host([selection-disabled]) .d2l-checkbox-action {
|
|
48
48
|
cursor: default;
|
|
49
49
|
}
|
|
50
50
|
` ];
|
|
@@ -95,6 +95,11 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
|
|
|
95
95
|
if (!suppressEvent) this._dispatchSelected(selected);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
willUpdate(changedProperties) {
|
|
99
|
+
super.willUpdate(changedProperties);
|
|
100
|
+
if (changedProperties.has('selectionDisabled') && this.selectionDisabled === true) this._hoveringSelection = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
98
103
|
async _dispatchSelected(value) {
|
|
99
104
|
/* wait for internal state to be updated in case of action-click case so that a consumer
|
|
100
105
|
calling getSelectionInfo will get the correct state */
|
|
@@ -124,6 +129,14 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
|
|
|
124
129
|
}
|
|
125
130
|
}
|
|
126
131
|
|
|
132
|
+
_onMouseEnterSelection() {
|
|
133
|
+
this._hoveringSelection = !this.selectionDisabled;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
_onMouseLeaveSelection() {
|
|
137
|
+
this._hoveringSelection = false;
|
|
138
|
+
}
|
|
139
|
+
|
|
127
140
|
_onNestedSlotChangeCheckboxMixin() {
|
|
128
141
|
this._updateNestedSelectionProvider();
|
|
129
142
|
}
|
|
@@ -144,19 +157,17 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
|
|
|
144
157
|
key="${this.key}"
|
|
145
158
|
label="${this.label}"
|
|
146
159
|
?skeleton="${this.skeleton}"
|
|
147
|
-
.hovering="${this.
|
|
160
|
+
.hovering="${this._hoveringSelection}">
|
|
148
161
|
</d2l-selection-input>
|
|
149
162
|
` : nothing;
|
|
150
163
|
}
|
|
151
164
|
|
|
152
165
|
_renderCheckboxAction(inner) {
|
|
153
|
-
const classes = {
|
|
154
|
-
'd2l-checkbox-action': true,
|
|
155
|
-
'd2l-checkbox-action-disabled': this.selectionDisabled
|
|
156
|
-
};
|
|
157
166
|
return this.selectable ? html`
|
|
158
167
|
<div @click="${this._onCheckboxActionClick}"
|
|
159
|
-
|
|
168
|
+
@mouseenter="${this._onMouseEnterSelection}"
|
|
169
|
+
@mouseleave="${this._onMouseLeaveSelection}"
|
|
170
|
+
class="d2l-checkbox-action">
|
|
160
171
|
${inner}
|
|
161
172
|
</div>
|
|
162
173
|
` : nothing;
|
|
@@ -21,29 +21,12 @@ export const ListItemLinkMixin = superclass => class extends ListItemMixin(super
|
|
|
21
21
|
:host([action-href]:not([action-href=""])) {
|
|
22
22
|
--d2l-list-item-content-text-color: var(--d2l-color-celestine);
|
|
23
23
|
}
|
|
24
|
-
:host([action-href]:not([action-href=""])[_hovering]) [slot="control-container"]::before,
|
|
25
|
-
:host([action-href]:not([action-href=""])[_hovering]) [slot="control-container"]::after,
|
|
26
|
-
:host([action-href]:not([action-href=""])[_focusing]) [slot="control-container"]::before,
|
|
27
|
-
:host([action-href]:not([action-href=""])[_focusing]) [slot="control-container"]::after {
|
|
28
|
-
border-top-color: transparent;
|
|
29
|
-
}
|
|
30
|
-
:host(:not([skeleton])[action-href]:not([action-href=""])[_hovering]) [slot="outside-control-container"],
|
|
31
|
-
:host(:not([skeleton])[action-href]:not([action-href=""])[_focusing]) [slot="outside-control-container"] {
|
|
32
|
-
background-color: white;
|
|
33
|
-
border-color: #b6cbe8; /* celestine alpha 0.3 */
|
|
34
|
-
}
|
|
35
|
-
:host(:not([skeleton])[action-href]:not([action-href=""])[_hovering]) [slot="outside-control-container"] {
|
|
36
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
37
|
-
}
|
|
38
24
|
a[href] {
|
|
39
25
|
display: block;
|
|
40
26
|
height: 100%;
|
|
41
27
|
outline: none;
|
|
42
28
|
width: 100%;
|
|
43
29
|
}
|
|
44
|
-
:host([skeleton]) a {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
30
|
` ];
|
|
48
31
|
|
|
49
32
|
super.styles && styles.unshift(super.styles);
|
|
@@ -56,6 +39,11 @@ export const ListItemLinkMixin = superclass => class extends ListItemMixin(super
|
|
|
56
39
|
this._primaryActionId = getUniqueId();
|
|
57
40
|
}
|
|
58
41
|
|
|
42
|
+
willUpdate(changedProperties) {
|
|
43
|
+
super.willUpdate(changedProperties);
|
|
44
|
+
if (changedProperties.has('actionHref') && !this.actionHref) this._hoveringPrimaryAction = false;
|
|
45
|
+
}
|
|
46
|
+
|
|
59
47
|
_handleLinkClick() {
|
|
60
48
|
/** Dispatched when the item's primary link action is clicked */
|
|
61
49
|
this.dispatchEvent(new CustomEvent('d2l-list-item-link-click', { bubbles: true }));
|
|
@@ -147,12 +147,16 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
147
147
|
:host(:last-of-type[_separators="between"]) [slot="control-container"]::after,
|
|
148
148
|
:host([_separators="none"]) [slot="control-container"]::before,
|
|
149
149
|
:host([_separators="none"]) [slot="control-container"]::after,
|
|
150
|
-
:host([
|
|
151
|
-
:host([
|
|
150
|
+
:host([_hovering-selection]) [slot="control-container"]::before,
|
|
151
|
+
:host([_hovering-selection]) [slot="control-container"]::after,
|
|
152
|
+
:host([_hovering-primary-action]) [slot="control-container"]::before,
|
|
153
|
+
:host([_hovering-primary-action]) [slot="control-container"]::after,
|
|
152
154
|
:host([selectable][_focusing]) [slot="control-container"]::before,
|
|
153
155
|
:host([selectable][_focusing]) [slot="control-container"]::after,
|
|
154
|
-
:host([
|
|
155
|
-
:host([
|
|
156
|
+
:host([_focusing-primary-action]) [slot="control-container"]::before,
|
|
157
|
+
:host([_focusing-primary-action]) [slot="control-container"]::after,
|
|
158
|
+
:host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::before,
|
|
159
|
+
:host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::after,
|
|
156
160
|
:host(:first-of-type[_nested]) [slot="control-container"]::before {
|
|
157
161
|
border-top-color: transparent;
|
|
158
162
|
}
|
|
@@ -317,17 +321,21 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
317
321
|
margin: 0;
|
|
318
322
|
}
|
|
319
323
|
|
|
320
|
-
:host(
|
|
321
|
-
:host(
|
|
324
|
+
:host([_hovering-primary-action]) [slot="outside-control-container"],
|
|
325
|
+
:host([_hovering-selection]) [slot="outside-control-container"],
|
|
326
|
+
:host([_focusing-primary-action]) [slot="outside-control-container"],
|
|
327
|
+
:host(:not([selection-disabled]):not([skeleton])[selected][_hovering-selection]) [slot="outside-control-container"],
|
|
322
328
|
:host(:not([selection-disabled]):not([skeleton])[selectable][_focusing]) [slot="outside-control-container"] {
|
|
323
329
|
background-color: white;
|
|
324
330
|
border-color: #b6cbe8; /* celestine alpha 0.3 */
|
|
325
331
|
}
|
|
326
|
-
:host(
|
|
332
|
+
:host([_hovering-primary-action]) [slot="outside-control-container"],
|
|
333
|
+
:host([_hovering-selection]) [slot="outside-control-container"] {
|
|
327
334
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
328
335
|
}
|
|
329
336
|
:host(:not([selection-disabled]):not([skeleton])[selected]) [slot="outside-control-container"] {
|
|
330
337
|
background-color: #f3fbff;
|
|
338
|
+
border-color: #b6cbe8; /* celestine alpha 0.3 */
|
|
331
339
|
}
|
|
332
340
|
|
|
333
341
|
:host(:not([selection-disabled]):not([skeleton])[padding-type="none"]) [slot="outside-control-container"] {
|
|
@@ -343,7 +351,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
343
351
|
transition: border-color 400ms linear;
|
|
344
352
|
}
|
|
345
353
|
:host([_highlighting]) [slot="outside-control-container"],
|
|
346
|
-
:host(
|
|
354
|
+
:host([_hovering-selection][_highlighting]) [slot="outside-control-container"],
|
|
347
355
|
:host(:not([selection-disabled]):not([skeleton])[_focusing][_highlighting]) [slot="outside-control-container"],
|
|
348
356
|
:host(:not([selection-disabled]):not([skeleton])[selected][_highlighting]) [slot="outside-control-container"] {
|
|
349
357
|
background-color: var(--d2l-color-celestine-plus-2);
|
|
@@ -363,6 +371,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
363
371
|
.d2l-list-item-tooltip-key {
|
|
364
372
|
font-weight: 700;
|
|
365
373
|
}
|
|
374
|
+
:host([skeleton]) {
|
|
375
|
+
pointer-events: none;
|
|
376
|
+
}
|
|
366
377
|
`];
|
|
367
378
|
|
|
368
379
|
super.styles && styles.unshift(super.styles);
|
|
@@ -632,7 +643,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
632
643
|
${this._renderExpandCollapse()}
|
|
633
644
|
</div>
|
|
634
645
|
${this.selectable ? html`<div slot="control">${this._renderCheckbox()}</div>` : nothing}
|
|
635
|
-
${this.selectable || this.expandable ? html
|
|
646
|
+
${this.selectable || this.expandable ? html`
|
|
647
|
+
<div slot="control-action"
|
|
636
648
|
@mouseenter="${this._onMouseEnter}"
|
|
637
649
|
@mouseleave="${this._onMouseLeave}">
|
|
638
650
|
${this._renderCheckboxAction('')}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.86.
|
|
3
|
+
"version": "2.86.4",
|
|
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",
|