@brightspace-ui/core 3.144.1 → 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';
@@ -843,6 +844,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
843
844
  ${this.draggable ? html`<div class="d2l-list-item-drag-image">${innerView}</div>` : innerView}
844
845
  ${this._renderBottomPlacementMarker(html`<d2l-list-item-placement-marker></d2l-list-item-placement-marker>`)}
845
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}
846
848
  `;
847
849
 
848
850
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.144.1",
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",