@brightspace-ui/core 2.147.0 → 2.147.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.
|
@@ -48,6 +48,7 @@ const ro = new ResizeObserver(entries => {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const defaultBreakpoints = [842, 636, 580, 0];
|
|
51
|
+
const SLIM_COLOR_BREAKPOINT = 400;
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* @property label - The hidden label for the checkbox and expand collapse control
|
|
@@ -99,7 +100,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
99
100
|
_highlight: { type: Boolean, reflect: true },
|
|
100
101
|
_highlighting: { type: Boolean, reflect: true },
|
|
101
102
|
_hasNestedList: { state: true },
|
|
102
|
-
_siblingHasColor: { state: true }
|
|
103
|
+
_siblingHasColor: { state: true },
|
|
104
|
+
_slimColor: { state: true }
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
|
|
@@ -293,6 +295,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
293
295
|
:host(:not([_render-expand-collapse-slot])) .d2l-list-item-content-extend-separators d2l-selection-input {
|
|
294
296
|
margin-inline-start: 0.9rem;
|
|
295
297
|
}
|
|
298
|
+
:host(:not([_render-expand-collapse-slot])[_has-color-slot]) .d2l-list-item-content-extend-separators d2l-selection-input {
|
|
299
|
+
margin-inline-start: 0.6rem;
|
|
300
|
+
}
|
|
296
301
|
|
|
297
302
|
d2l-list-item-drag-handle {
|
|
298
303
|
margin: 0.25rem 0.3rem;
|
|
@@ -391,6 +396,10 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
391
396
|
height: 100%;
|
|
392
397
|
width: 6px;
|
|
393
398
|
}
|
|
399
|
+
.d2l-list-item-color-inner.d2l-list-item-color-slim {
|
|
400
|
+
border-radius: 3px;
|
|
401
|
+
width: 3px;
|
|
402
|
+
}
|
|
394
403
|
.d2l-list-item-color-outer {
|
|
395
404
|
padding: 2px 12px 1px 0;
|
|
396
405
|
}
|
|
@@ -435,6 +444,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
435
444
|
this._hasColorSlot = false;
|
|
436
445
|
this._hasNestedList = false;
|
|
437
446
|
this._siblingHasColor = false;
|
|
447
|
+
this._slimColor = false;
|
|
438
448
|
}
|
|
439
449
|
|
|
440
450
|
get breakpoints() {
|
|
@@ -512,6 +522,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
512
522
|
}
|
|
513
523
|
|
|
514
524
|
resizedCallback(width) {
|
|
525
|
+
this._slimColor = (width < SLIM_COLOR_BREAKPOINT);
|
|
526
|
+
|
|
515
527
|
const lastBreakpointIndexToCheck = 3;
|
|
516
528
|
this.breakpoints.some((breakpoint, index) => {
|
|
517
529
|
if (width >= breakpoint || index > lastBreakpointIndexToCheck) {
|
|
@@ -674,6 +686,10 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
674
686
|
const colorStyles = {
|
|
675
687
|
backgroundColor: this._hasColorSlot ? this.color : undefined
|
|
676
688
|
};
|
|
689
|
+
const colorClasses = {
|
|
690
|
+
'd2l-list-item-color-inner': true,
|
|
691
|
+
'd2l-list-item-color-slim': this._slimColor
|
|
692
|
+
};
|
|
677
693
|
|
|
678
694
|
const alignNested = ((this.draggable && this.selectable) || (this.expandable && this.selectable && this.color)) ? 'control' : undefined;
|
|
679
695
|
const primaryAction = ((!this.noPrimaryAction && this._renderPrimaryAction) ? this._renderPrimaryAction(this._contentId) : null);
|
|
@@ -695,7 +711,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
|
695
711
|
<div slot="control-container"></div>
|
|
696
712
|
${this._hasColorSlot ? html`
|
|
697
713
|
<div slot="color-indicator" class="d2l-list-item-color-outer">
|
|
698
|
-
<div class="
|
|
714
|
+
<div class="${classMap(colorClasses)}" style="${styleMap(colorStyles)}"></div>
|
|
699
715
|
</div>` : nothing}
|
|
700
716
|
<div slot="expand-collapse" class="d2l-list-expand-collapse" @click="${this._toggleExpandCollapse}">
|
|
701
717
|
${this._renderExpandCollapse()}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.147.
|
|
3
|
+
"version": "2.147.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",
|