@brightspace-ui/core 2.177.1 → 2.177.2
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/demo-list-nested.js +6 -1
- package/components/list/demo/list-drag-and-drop.html +8 -0
- package/components/list/demo/list-expand-collapse.html +2 -0
- package/components/list/demo/list-nested.html +1 -1
- package/components/list/list-item-mixin.js +5 -3
- package/custom-elements.json +9 -0
- package/package.json +1 -1
@@ -19,6 +19,7 @@ class ListDemoNested extends LitElement {
|
|
19
19
|
|
20
20
|
static get properties() {
|
21
21
|
return {
|
22
|
+
addButton: { type: Boolean, attribute: 'add-button' },
|
22
23
|
demoItemKey: { type: String, attribute: 'demo-item-key' },
|
23
24
|
isDraggable: { attribute: 'is-draggable', type: Boolean },
|
24
25
|
selectable: { type: Boolean },
|
@@ -169,7 +170,11 @@ class ListDemoNested extends LitElement {
|
|
169
170
|
|
170
171
|
_renderList(items, nested, includeControls = false, showLoadMore = false) {
|
171
172
|
return html`
|
172
|
-
<d2l-list
|
173
|
+
<d2l-list
|
174
|
+
?grid="${!this.disableListGrid}"
|
175
|
+
drag-multiple slot="${ifDefined(nested ? 'nested' : undefined)}"
|
176
|
+
item-count="${this._items.length}"
|
177
|
+
?add-button="${this.addButton}">
|
173
178
|
${ includeControls ? this._renderListControls() : nothing }
|
174
179
|
${repeat(items, item => item.key, item => html`
|
175
180
|
${this._renderListItem(item)}
|
@@ -38,6 +38,14 @@
|
|
38
38
|
</template>
|
39
39
|
</d2l-demo-snippet>
|
40
40
|
|
41
|
+
<h2>Add Button</h2>
|
42
|
+
|
43
|
+
<d2l-demo-snippet>
|
44
|
+
<template>
|
45
|
+
<d2l-demo-list-nested add-button demo-item-key="imgPrimaryAndSupporting" is-draggable selectable></d2l-demo-list-nested>
|
46
|
+
</template>
|
47
|
+
</d2l-demo-snippet>
|
48
|
+
|
41
49
|
|
42
50
|
</d2l-demo-page>
|
43
51
|
|
@@ -18,6 +18,7 @@
|
|
18
18
|
<template>
|
19
19
|
<d2l-demo-list-nested
|
20
20
|
demo-item-key="imgPrimaryAndSupporting"
|
21
|
+
add-button
|
21
22
|
is-draggable
|
22
23
|
selectable
|
23
24
|
expandable
|
@@ -45,6 +46,7 @@
|
|
45
46
|
<template>
|
46
47
|
<d2l-demo-list-nested
|
47
48
|
demo-item-key="imgPrimaryAndSupporting"
|
49
|
+
add-button
|
48
50
|
is-draggable
|
49
51
|
selectable
|
50
52
|
expandable
|
@@ -131,7 +131,7 @@
|
|
131
131
|
<div>Earth Sciences (L1)</div>
|
132
132
|
<div slot="supporting-info">Earth science or geoscience includes all fields of natural science related to planet Earth. This is a branch of science dealing with the physical and chemical constitution of Earth and its atmosphere. Earth science can be considered to be a branch of planetary science, but with a much older history.</div>
|
133
133
|
</d2l-list-item-content>
|
134
|
-
<d2l-list slot="nested" grid separators="all">
|
134
|
+
<d2l-list add-button slot="nested" grid separators="all">
|
135
135
|
<d2l-list-item selectable key="L2-1" label="Label for L2-1">
|
136
136
|
<d2l-list-item-content>
|
137
137
|
<div>Introductory Earth Sciences (L2)</div>
|
@@ -153,8 +153,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
153
153
|
:host([_focusing-primary-action]) [slot="control-container"]::after,
|
154
154
|
:host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::before,
|
155
155
|
:host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::after,
|
156
|
-
:host([_show-add-button]) [slot="control-container"]::after,
|
157
156
|
:host([_show-add-button]) [slot="control-container"]::before,
|
157
|
+
:host([_show-add-button]) [slot="control-container"]::after,
|
158
158
|
:host(:first-of-type[_nested]) [slot="control-container"]::before {
|
159
159
|
border-top-color: transparent;
|
160
160
|
}
|
@@ -413,7 +413,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
413
413
|
margin-top: -11.5px;
|
414
414
|
}
|
415
415
|
:host([draggable][selectable][_hovering]) [slot="add"],
|
416
|
-
:host([draggable][selectable][_focusing]) [slot="add"]
|
416
|
+
:host([draggable][selectable][_focusing]) [slot="add"],
|
417
|
+
:host([draggable][selectable][_hovering]) [slot="add-top"],
|
418
|
+
:host([draggable][selectable][_focusing]) [slot="add-top"] {
|
417
419
|
padding-inline-end: 6px;
|
418
420
|
}
|
419
421
|
.dragging [slot="add"] {
|
@@ -719,7 +721,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
719
721
|
class="d2l-list-item-actions-container">
|
720
722
|
<slot name="actions" class="d2l-list-item-actions">${actions}</slot>
|
721
723
|
</div>
|
722
|
-
${this._showAddButton && !this._hasNestedListAddButton ? html`
|
724
|
+
${this._showAddButton && (!this._hasNestedListAddButton || (this.expandable && !this.expanded)) ? html`
|
723
725
|
<div slot="add">
|
724
726
|
<d2l-button-add text="${addButtonText}" mode="icon-when-interacted" @click="${this._handleButtonAddClick}"></d2l-button-add>
|
725
727
|
</div>
|
package/custom-elements.json
CHANGED
@@ -7785,6 +7785,10 @@
|
|
7785
7785
|
"name": "d2l-demo-list-nested",
|
7786
7786
|
"path": "./components/list/demo/demo-list-nested.js",
|
7787
7787
|
"attributes": [
|
7788
|
+
{
|
7789
|
+
"name": "add-button",
|
7790
|
+
"type": "boolean"
|
7791
|
+
},
|
7788
7792
|
{
|
7789
7793
|
"name": "demo-item-key",
|
7790
7794
|
"type": "string"
|
@@ -7835,6 +7839,11 @@
|
|
7835
7839
|
}
|
7836
7840
|
],
|
7837
7841
|
"properties": [
|
7842
|
+
{
|
7843
|
+
"name": "addButton",
|
7844
|
+
"attribute": "add-button",
|
7845
|
+
"type": "boolean"
|
7846
|
+
},
|
7838
7847
|
{
|
7839
7848
|
"name": "demoItemKey",
|
7840
7849
|
"attribute": "demo-item-key",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "2.177.
|
3
|
+
"version": "2.177.2",
|
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",
|