@brightspace-ui/core 3.148.8 → 3.148.10
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.
@@ -123,14 +123,14 @@ class ListDemoNav extends LitElement {
|
|
123
123
|
|
124
124
|
this.requestUpdate();
|
125
125
|
await this.updateComplete;
|
126
|
-
await this.updateComplete;
|
127
126
|
|
128
127
|
if (e.detail.keyboardActive) {
|
129
|
-
setTimeout(() => {
|
128
|
+
setTimeout(async() => {
|
130
129
|
if (!this.shadowRoot) return;
|
131
130
|
const newItem = this.shadowRoot.querySelector('d2l-list').getListItemByKey(sourceListItems[0].key);
|
131
|
+
await newItem.waitForUpdateComplete();
|
132
132
|
newItem.activateDragHandle();
|
133
|
-
}
|
133
|
+
});
|
134
134
|
}
|
135
135
|
}
|
136
136
|
|
@@ -8,7 +8,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
8
|
class ListNestedIterationsHelper extends LitElement {
|
9
9
|
static get properties() {
|
10
10
|
return {
|
11
|
-
isDraggable: { attribute: 'is-draggable', type: Boolean }
|
11
|
+
isDraggable: { attribute: 'is-draggable', type: Boolean },
|
12
|
+
separators: { type: String }
|
12
13
|
};
|
13
14
|
}
|
14
15
|
|
@@ -109,7 +110,7 @@ class ListNestedIterationsHelper extends LitElement {
|
|
109
110
|
|
110
111
|
_createList(parentOptions, childrenOptions) {
|
111
112
|
return html`
|
112
|
-
<d2l-list>
|
113
|
+
<d2l-list separators=${ifDefined(this.separators)}>
|
113
114
|
${this._getParentItems(parentOptions, this._getChildItems(childrenOptions))}
|
114
115
|
</d2l-list>
|
115
116
|
`;
|
@@ -133,7 +134,7 @@ class ListNestedIterationsHelper extends LitElement {
|
|
133
134
|
<d2l-list-item key="${childKey}" label="${childL2Text}" ?selectable="${!!childOptions[0]}" ?draggable="${this.isDraggable}" ?expandable="${childOptions[1] && i !== 1}" color="${ifDefined((childOptions[2] && i === 0) || childOptions[3] ? '#ff0000' : undefined)}">
|
134
135
|
<d2l-list-item-content>${childL2Text}</d2l-list-item-content>
|
135
136
|
${i === 1 || !childOptions[1] ? nothing : html`
|
136
|
-
<d2l-list slot="nested">
|
137
|
+
<d2l-list slot="nested" separators=${ifDefined(this.separators)}>
|
137
138
|
<d2l-list-item key="${`${childKey}-child`}" label="${childL3Text}" ?selectable="${!!childOptions[0]}" ?draggable="${this.isDraggable}" color="${ifDefined(childOptions[3] ? '#00ff00' : undefined)}">
|
138
139
|
<d2l-list-item-content>${childL3Text}</d2l-list-item-content>
|
139
140
|
</d2l-list-item>
|
@@ -155,7 +156,7 @@ class ListNestedIterationsHelper extends LitElement {
|
|
155
156
|
<d2l-list-item key="${parentKey}" label="${parentText}" ?selectable="${!!parentOptions[0]}" ?draggable="${this.isDraggable}" ?expandable="${parentOptions[1] && i !== 1}" ?expanded="${parentOptions[1] && i === 0}" color="${ifDefined((parentOptions[2] && i === 0) || parentOptions[3] ? '#ff0000' : undefined)}">
|
156
157
|
<d2l-list-item-content>${parentText}</d2l-list-item-content>
|
157
158
|
${i === 1 || (i === 2 && !parentOptions[1]) ? nothing : html`
|
158
|
-
<d2l-list slot="nested">${nested}</d2l-list>
|
159
|
+
<d2l-list slot="nested" separators=${ifDefined(this.separators)}>${nested}</d2l-list>
|
159
160
|
`}
|
160
161
|
</d2l-list-item>
|
161
162
|
`);
|
@@ -134,14 +134,14 @@ class ListDemoNested extends LitElement {
|
|
134
134
|
|
135
135
|
this.requestUpdate();
|
136
136
|
await this.updateComplete;
|
137
|
-
await this.updateComplete;
|
138
137
|
|
139
138
|
if (e.detail.keyboardActive) {
|
140
|
-
setTimeout(() => {
|
139
|
+
setTimeout(async() => {
|
141
140
|
if (!this.shadowRoot) return;
|
142
141
|
const newItem = this.shadowRoot.querySelector('d2l-list').getListItemByKey(sourceListItems[0].key);
|
142
|
+
await newItem.waitForUpdateComplete();
|
143
143
|
newItem.activateDragHandle();
|
144
|
-
}
|
144
|
+
});
|
145
145
|
}
|
146
146
|
|
147
147
|
}
|
@@ -6,7 +6,7 @@ import './list-item-placement-marker.js';
|
|
6
6
|
import '../tooltip/tooltip.js';
|
7
7
|
import '../expand-collapse/expand-collapse-content.js';
|
8
8
|
import { css, html, nothing, unsafeCSS } from 'lit';
|
9
|
-
import { findComposedAncestor, getComposedParent } from '../../helpers/dom.js';
|
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';
|
@@ -24,6 +24,7 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
24
24
|
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
25
25
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
26
26
|
import { styleMap } from 'lit/directives/style-map.js';
|
27
|
+
import { waitForElem } from '../../helpers/internal/waitForElem.js';
|
27
28
|
|
28
29
|
let tabPressed = false;
|
29
30
|
let tabListenerAdded = false;
|
@@ -150,8 +151,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
150
151
|
|
151
152
|
:host(:first-of-type) [slot="control-container"]::before,
|
152
153
|
[slot="control-container"]::after,
|
153
|
-
:host([_list-item-new-styles][expandable][expanded]:not(:last-of-type))::after,
|
154
|
-
:host([_list-item-new-styles][_has-nested-list]:not([expandable]):not(:last-of-type))::after {
|
154
|
+
:host([_list-item-new-styles]:not([_separators="none"])[expandable][expanded]:not(:last-of-type))::after,
|
155
|
+
:host([_list-item-new-styles]:not([_separators="none"])[_has-nested-list]:not([expandable]):not(:last-of-type))::after {
|
155
156
|
border-top: 1px solid var(--d2l-color-mica);
|
156
157
|
content: "";
|
157
158
|
position: absolute;
|
@@ -594,6 +595,12 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
594
595
|
this._siblingHasColor = siblingHasColor;
|
595
596
|
}
|
596
597
|
|
598
|
+
async waitForUpdateComplete() {
|
599
|
+
const predicate = () => true;
|
600
|
+
const composedChildren = getComposedChildren(this, predicate);
|
601
|
+
await Promise.all(composedChildren.map(child => waitForElem(child, predicate)));
|
602
|
+
}
|
603
|
+
|
597
604
|
_getFlattenedListItems(listItem) {
|
598
605
|
const listItems = new Map();
|
599
606
|
const lazyLoadListItems = new Map();
|
package/custom-elements.json
CHANGED
@@ -8421,6 +8421,10 @@
|
|
8421
8421
|
"name": "d2l-demo-list-nested-iterations-helper",
|
8422
8422
|
"path": "./components/list/demo/demo-list-nested-iterations-helper.js",
|
8423
8423
|
"attributes": [
|
8424
|
+
{
|
8425
|
+
"name": "separators",
|
8426
|
+
"type": "string"
|
8427
|
+
},
|
8424
8428
|
{
|
8425
8429
|
"name": "is-draggable",
|
8426
8430
|
"type": "boolean",
|
@@ -8428,6 +8432,11 @@
|
|
8428
8432
|
}
|
8429
8433
|
],
|
8430
8434
|
"properties": [
|
8435
|
+
{
|
8436
|
+
"name": "separators",
|
8437
|
+
"attribute": "separators",
|
8438
|
+
"type": "string"
|
8439
|
+
},
|
8431
8440
|
{
|
8432
8441
|
"name": "isDraggable",
|
8433
8442
|
"attribute": "is-draggable",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.148.
|
3
|
+
"version": "3.148.10",
|
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",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"dependencies": {
|
69
69
|
"@brightspace-ui/intl": "^3",
|
70
70
|
"@brightspace-ui/lms-context-provider": "^1",
|
71
|
-
"@open-wc/dedupe-mixin": "^
|
71
|
+
"@open-wc/dedupe-mixin": "^2",
|
72
72
|
"ifrau": "^0.41",
|
73
73
|
"lit": "^3",
|
74
74
|
"prismjs": "^1",
|