@brightspace-ui/core 3.206.3 → 3.207.0
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.
|
@@ -34,6 +34,7 @@ class ListDemoNested extends LitElement {
|
|
|
34
34
|
showLoadMore: { type: Boolean, attribute: 'show-load-more' },
|
|
35
35
|
noPrimaryAction: { type: Boolean, attribute: 'no-primary-action' },
|
|
36
36
|
disableListGrid: { type: Boolean, attribute: 'disable-list-grid' },
|
|
37
|
+
dragHandleShowAlways: { type: Boolean, attribute: 'drag-handle-show-always' },
|
|
37
38
|
_items: { state: true },
|
|
38
39
|
_loadedItems: { state: true },
|
|
39
40
|
_remainingItemCount: { state: true },
|
|
@@ -176,6 +177,7 @@ class ListDemoNested extends LitElement {
|
|
|
176
177
|
<d2l-list
|
|
177
178
|
?grid="${!this.disableListGrid}"
|
|
178
179
|
drag-multiple
|
|
180
|
+
?drag-handle-show-always="${this.dragHandleShowAlways}"
|
|
179
181
|
?drop-nested-only="${this.dropNestedOnly}"
|
|
180
182
|
slot="${ifDefined(nested ? 'nested' : undefined)}"
|
|
181
183
|
item-count="${this._items.length}"
|
|
@@ -62,6 +62,13 @@
|
|
|
62
62
|
</template>
|
|
63
63
|
</d2l-demo-snippet>
|
|
64
64
|
|
|
65
|
+
<h2>Always Show Handle</h2>
|
|
66
|
+
|
|
67
|
+
<d2l-demo-snippet>
|
|
68
|
+
<template>
|
|
69
|
+
<d2l-demo-list-nested demo-item-key="imgPrimaryAndSupporting" is-draggable selectable drag-handle-show-always></d2l-demo-list-nested>
|
|
70
|
+
</template>
|
|
71
|
+
</d2l-demo-snippet>
|
|
65
72
|
|
|
66
73
|
</d2l-demo-page>
|
|
67
74
|
|
|
@@ -268,23 +268,24 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
|
268
268
|
/**
|
|
269
269
|
* **Drag & drop:** The drag-handle label for assistive technology. If implementing drag & drop, you should change this to dynamically announce what the drag-handle is moving for assistive technology in keyboard mode.
|
|
270
270
|
* @type {string}
|
|
271
|
-
|
|
271
|
+
*/
|
|
272
272
|
dragHandleText: { type: String, attribute: 'drag-handle-text' },
|
|
273
273
|
/**
|
|
274
274
|
* **Drag & drop:** Whether nested items can be dropped on this item
|
|
275
275
|
* @type {boolean}
|
|
276
|
-
|
|
276
|
+
*/
|
|
277
277
|
dropNested: { type: Boolean, attribute: 'drop-nested' },
|
|
278
278
|
/**
|
|
279
279
|
* **Drag & drop:** Text to drag and drop
|
|
280
280
|
* @type {string}
|
|
281
|
-
|
|
281
|
+
*/
|
|
282
282
|
dropText: { type: String, attribute: 'drop-text' },
|
|
283
283
|
/**
|
|
284
284
|
* Value to identify item if selectable
|
|
285
285
|
* @type {string}
|
|
286
|
-
|
|
286
|
+
*/
|
|
287
287
|
key: { type: String, reflect: true },
|
|
288
|
+
_dragHandleShowAlways: { type: Boolean, attribute: '_drag-handle-show-always', reflect: true },
|
|
288
289
|
_draggingOver: { type: Boolean },
|
|
289
290
|
_dropLocation: { type: Number, reflect: true, attribute: '_drop-location' },
|
|
290
291
|
_focusingDragHandle: { type: Boolean },
|
|
@@ -345,6 +346,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
|
345
346
|
}
|
|
346
347
|
:host([selected]) d2l-list-item-drag-handle,
|
|
347
348
|
:host([current]) d2l-list-item-drag-handle,
|
|
349
|
+
:host([_drag-handle-show-always]) d2l-list-item-drag-handle,
|
|
348
350
|
:host([_focusing]) d2l-list-item-drag-handle,
|
|
349
351
|
d2l-list-item-drag-handle:hover,
|
|
350
352
|
d2l-list-item-drag-handle.d2l-hovering,
|
|
@@ -379,6 +381,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
|
379
381
|
const list = this.getRootList();
|
|
380
382
|
this._dragMultiple = list?.hasAttribute('drag-multiple');
|
|
381
383
|
this._dropNestedOnly = list?.hasAttribute('drop-nested-only');
|
|
384
|
+
this._dragHandleShowAlways = list?.dragHandleShowAlways;
|
|
382
385
|
}
|
|
383
386
|
|
|
384
387
|
firstUpdated(changedProperties) {
|
package/components/list/list.js
CHANGED
|
@@ -53,6 +53,11 @@ class List extends PageableMixin(SelectionMixin(LitElement)) {
|
|
|
53
53
|
* @type {array}
|
|
54
54
|
*/
|
|
55
55
|
breakpoints: { type: Array },
|
|
56
|
+
/**
|
|
57
|
+
* Always show drag handle
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
*/
|
|
60
|
+
dragHandleShowAlways: { type: Boolean, attribute: 'drag-handle-show-always' },
|
|
56
61
|
/**
|
|
57
62
|
* Whether the user can drag multiple items
|
|
58
63
|
* @type {boolean}
|
|
@@ -264,6 +269,9 @@ class List extends PageableMixin(SelectionMixin(LitElement)) {
|
|
|
264
269
|
if (changedProperties.has('layout') && changedProperties.get('layout') !== undefined && this.layout) {
|
|
265
270
|
this._updateItemLayouts();
|
|
266
271
|
}
|
|
272
|
+
if (changedProperties.has('dragHandleShowAlways')) {
|
|
273
|
+
this._updateItemDragHandleShowAlways();
|
|
274
|
+
}
|
|
267
275
|
}
|
|
268
276
|
|
|
269
277
|
getItems(slot) {
|
|
@@ -500,6 +508,7 @@ class List extends PageableMixin(SelectionMixin(LitElement)) {
|
|
|
500
508
|
});
|
|
501
509
|
|
|
502
510
|
this._updateItemLayouts(items);
|
|
511
|
+
this._updateItemDragHandleShowAlways(items);
|
|
503
512
|
|
|
504
513
|
/** @ignore */
|
|
505
514
|
this.dispatchEvent(new CustomEvent('d2l-list-item-showing-count-change', {
|
|
@@ -522,11 +531,15 @@ class List extends PageableMixin(SelectionMixin(LitElement)) {
|
|
|
522
531
|
});
|
|
523
532
|
}
|
|
524
533
|
|
|
534
|
+
_updateItemDragHandleShowAlways(items) {
|
|
535
|
+
if (!items) items = this.getItems();
|
|
536
|
+
items.forEach(item => item._dragHandleShowAlways = this.dragHandleShowAlways);
|
|
537
|
+
}
|
|
538
|
+
|
|
525
539
|
_updateItemLayouts(items) {
|
|
526
540
|
if (!items) items = this.getItems();
|
|
527
541
|
items.forEach(item => item.layout = (this.layout === listLayouts.tiles ? 'tile' : 'normal'));
|
|
528
542
|
}
|
|
529
|
-
|
|
530
543
|
}
|
|
531
544
|
|
|
532
545
|
customElements.define('d2l-list', List);
|
package/custom-elements.json
CHANGED
|
@@ -8759,6 +8759,10 @@
|
|
|
8759
8759
|
{
|
|
8760
8760
|
"name": "disable-list-grid",
|
|
8761
8761
|
"type": "boolean"
|
|
8762
|
+
},
|
|
8763
|
+
{
|
|
8764
|
+
"name": "drag-handle-show-always",
|
|
8765
|
+
"type": "boolean"
|
|
8762
8766
|
}
|
|
8763
8767
|
],
|
|
8764
8768
|
"properties": [
|
|
@@ -8836,6 +8840,11 @@
|
|
|
8836
8840
|
"name": "disableListGrid",
|
|
8837
8841
|
"attribute": "disable-list-grid",
|
|
8838
8842
|
"type": "boolean"
|
|
8843
|
+
},
|
|
8844
|
+
{
|
|
8845
|
+
"name": "dragHandleShowAlways",
|
|
8846
|
+
"attribute": "drag-handle-show-always",
|
|
8847
|
+
"type": "boolean"
|
|
8839
8848
|
}
|
|
8840
8849
|
]
|
|
8841
8850
|
},
|
|
@@ -10589,6 +10598,11 @@
|
|
|
10589
10598
|
"description": "Text to show in label tooltip on inline add button. Defaults to \"Add Item\".",
|
|
10590
10599
|
"type": "string"
|
|
10591
10600
|
},
|
|
10601
|
+
{
|
|
10602
|
+
"name": "drag-handle-show-always",
|
|
10603
|
+
"description": "Always show drag handle",
|
|
10604
|
+
"type": "boolean"
|
|
10605
|
+
},
|
|
10592
10606
|
{
|
|
10593
10607
|
"name": "drop-nested-only",
|
|
10594
10608
|
"description": "Disable ability to drop items above or below this item",
|
|
@@ -10660,6 +10674,12 @@
|
|
|
10660
10674
|
"description": "Text to show in label tooltip on inline add button. Defaults to \"Add Item\".",
|
|
10661
10675
|
"type": "string"
|
|
10662
10676
|
},
|
|
10677
|
+
{
|
|
10678
|
+
"name": "dragHandleShowAlways",
|
|
10679
|
+
"attribute": "drag-handle-show-always",
|
|
10680
|
+
"description": "Always show drag handle",
|
|
10681
|
+
"type": "boolean"
|
|
10682
|
+
},
|
|
10663
10683
|
{
|
|
10664
10684
|
"name": "dropNestedOnly",
|
|
10665
10685
|
"attribute": "drop-nested-only",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.207.0",
|
|
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",
|