dragselect 3.0.5 → 3.0.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 3.0.6
2
+
3
+ - Expose the Drag class publicly, solves [#224](https://github.com/ThibaultJanBeyer/DragSelect/issues/224)
4
+
1
5
  # 3.0.5
2
6
 
3
7
  - Fix type issue during build bug [#212](https://github.com/ThibaultJanBeyer/DragSelect/issues/212)
@@ -564,6 +564,43 @@ declare class Area<E extends DSInputElement> {
564
564
  private get parentNodes();
565
565
  }
566
566
 
567
+ declare class Drag<E extends DSInputElement> {
568
+ private _prevCursorPos?;
569
+ private _prevScrollPos?;
570
+ private _elements;
571
+ private _dragKeys?;
572
+ private _dragKeysFlat;
573
+ private _selectionRect;
574
+ DS: DragSelect<E>;
575
+ PS: PubSub<E>;
576
+ Settings: DSSettings<E>;
577
+ constructor({ DS, PS }: {
578
+ DS: DragSelect<E>;
579
+ PS: PubSub<E>;
580
+ });
581
+ private assignDragKeys;
582
+ private keyboardDrag;
583
+ private keyboardEnd;
584
+ private start;
585
+ stop: () => void;
586
+ private update;
587
+ private handleZIndex;
588
+ private moveElements;
589
+ private get _cursorDiff();
590
+ private get _scrollDiff();
591
+ /**
592
+ * Can be overridden to apply further filtering logic after the items to move are identified but before they actually get moved
593
+ * Is expected to return the elements in the same shape as passed in
594
+ */
595
+ filterDragElements: ({ elements, direction, }: {
596
+ elements: E[];
597
+ direction: Vect2;
598
+ }) => {
599
+ elements: E[];
600
+ direction: Vect2;
601
+ };
602
+ }
603
+
567
604
  declare class DropZones<E extends DSInputElement> {
568
605
  /** Get the drop zone by the zone element */
569
606
  private _zoneByElement;
@@ -751,7 +788,7 @@ declare class DragSelect<E extends DSInputElement = DSInputElement> {
751
788
  SelectableSet: SelectableSet<E>;
752
789
  SelectedSet: SelectedSet<E>;
753
790
  Selection: Selection<E>;
754
- private Drag;
791
+ Drag: Drag<E>;
755
792
  DropZones: DropZones<E>;
756
793
  Interaction: Interaction<E>;
757
794
  stopped: boolean;
@@ -1,6 +1,6 @@
1
1
  /***
2
2
 
3
- ~~~ Version 3.0.4 ~~~
3
+ ~~~ Version 3.0.6 ~~~
4
4
 
5
5
  ******************************************
6
6
 
@@ -1,6 +1,6 @@
1
1
  /***
2
2
 
3
- ~~~ Version 3.0.4 ~~~
3
+ ~~~ Version 3.0.6 ~~~
4
4
 
5
5
  ******************************************
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragselect",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Easy JavaScript library for selecting and moving elements. With no dependencies. Drag-Select & Drag-And-Drop.",
5
5
  "main": "./dist/DragSelect.js",
6
6
  "module": "./dist/DragSelect.esm.js",