@brightspace-ui/core 3.144.0 → 3.144.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.
@@ -4,6 +4,7 @@ import { findComposedAncestor, isComposedAncestor } from '../../helpers/dom.js';
|
|
4
4
|
import { announce } from '../../helpers/announce.js';
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
6
6
|
import { dragActions } from './list-item-drag-handle.js';
|
7
|
+
import { getFlag } from '../../helpers/flags.js';
|
7
8
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
8
9
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
9
10
|
import { SelectionInfo } from '../selection/selection-mixin.js';
|
@@ -21,6 +22,8 @@ export const moveLocations = Object.freeze({
|
|
21
22
|
|
22
23
|
export const dropLocation = moveLocations; // backwards compatibility
|
23
24
|
|
25
|
+
const dragDropMultipleFlag = getFlag('GAUD-7495-list-item-drag-drop-multiple', true);
|
26
|
+
|
24
27
|
const dropTargetLeaveDelay = 1000; // ms
|
25
28
|
const touchHoldDuration = 400; // length of time user needs to hold down touch before dragging occurs
|
26
29
|
const scrollSensitivity = 150; // pixels between top/bottom of viewport to scroll for mobile
|
@@ -368,6 +371,9 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
368
371
|
if (!this.key) {
|
369
372
|
this.draggable = false;
|
370
373
|
}
|
374
|
+
|
375
|
+
if (!dragDropMultipleFlag) return;
|
376
|
+
this._dragMultiple = this.getRootList()?.hasAttribute('drag-multiple');
|
371
377
|
}
|
372
378
|
|
373
379
|
firstUpdated(changedProperties) {
|
@@ -871,6 +877,12 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
871
877
|
`) : nothing;
|
872
878
|
}
|
873
879
|
|
880
|
+
_renderDragMultipleImage() {
|
881
|
+
if (!dragDropMultipleFlag) return nothing;
|
882
|
+
|
883
|
+
return this._dragMultiple && this.draggable && (this.selectable || this.expandable) ? html`<d2l-list-item-drag-image></d2l-list-item-drag-image>` : nothing;
|
884
|
+
}
|
885
|
+
|
874
886
|
_renderDragTarget(templateMethod) {
|
875
887
|
templateMethod = templateMethod || (dragTarget => dragTarget);
|
876
888
|
return this.draggable && !this._keyboardActive ? templateMethod.call(this, html`
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import '../button/button-add.js';
|
2
2
|
import '../colors/colors.js';
|
3
|
+
import './list-item-drag-image.js';
|
3
4
|
import './list-item-generic-layout.js';
|
4
5
|
import './list-item-placement-marker.js';
|
5
6
|
import '../tooltip/tooltip.js';
|
@@ -143,12 +144,19 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
143
144
|
}
|
144
145
|
|
145
146
|
:host(:first-of-type) [slot="control-container"]::before,
|
146
|
-
[slot="control-container"]::after
|
147
|
+
[slot="control-container"]::after,
|
148
|
+
:host([_list-item-new-styles][expandable][expanded]:not(:last-of-type))::after,
|
149
|
+
:host([_list-item-new-styles][_has-nested-list]:not([expandable]):not(:last-of-type))::after {
|
147
150
|
border-top: 1px solid var(--d2l-color-mica);
|
148
151
|
content: "";
|
149
152
|
position: absolute;
|
150
153
|
width: 100%;
|
151
154
|
}
|
155
|
+
:host([_list-item-new-styles][draggable][expandable][expanded]:not(:last-of-type))::after,
|
156
|
+
:host([_list-item-new-styles][draggable][_has-nested-list]:not([expandable]):not(:last-of-type))::after {
|
157
|
+
inset-inline-start: 1.5rem; /* left and right margins of 0.3rem + drag handle width of 0.9rem */
|
158
|
+
width: calc(100% - 1.5rem);
|
159
|
+
}
|
152
160
|
:host(:not([_white-background-add-button])[_has-nested-list-add-button]) [slot="before-content"] {
|
153
161
|
border-bottom: 1px solid var(--d2l-color-mica);
|
154
162
|
margin-bottom: -1px;
|
@@ -836,6 +844,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
836
844
|
${this.draggable ? html`<div class="d2l-list-item-drag-image">${innerView}</div>` : innerView}
|
837
845
|
${this._renderBottomPlacementMarker(html`<d2l-list-item-placement-marker></d2l-list-item-placement-marker>`)}
|
838
846
|
${this._displayKeyboardTooltip && tooltipForId ? html`<d2l-tooltip align="start" announced for="${tooltipForId}" for-type="descriptor">${this.localizeHTML('components.list.keyboard')}</d2l-tooltip>` : ''}
|
847
|
+
${this.draggable ? this._renderDragMultipleImage() : nothing}
|
839
848
|
`;
|
840
849
|
|
841
850
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.144.
|
3
|
+
"version": "3.144.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",
|