ngx-virtual-dnd 3.1.2 → 3.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-virtual-dnd",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "A performant drag-and-drop library for Angular that works seamlessly with virtual scrolling",
5
5
  "keywords": [
6
6
  "angular",
@@ -19,11 +19,11 @@
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "git+https://github.com/gultyayev/angular-vdnd.git"
22
+ "url": "git+https://github.com/gultyayev/ngx-virtual-dnd.git"
23
23
  },
24
- "homepage": "https://github.com/gultyayev/angular-vdnd#readme",
24
+ "homepage": "https://github.com/gultyayev/ngx-virtual-dnd#readme",
25
25
  "bugs": {
26
- "url": "https://github.com/gultyayev/angular-vdnd/issues"
26
+ "url": "https://github.com/gultyayev/ngx-virtual-dnd/issues"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@angular/common": "^21.0.0 || ^22.0.0",
@@ -59,7 +59,7 @@ interface DragState {
59
59
  grabOffset: GrabOffset | null;
60
60
  /** Position when drag started (for axis locking) */
61
61
  initialPosition: CursorPosition | null;
62
- /** Axis to lock movement to ('x' = horizontal only, 'y' = vertical only) */
62
+ /** Axis to freeze ('x' = X frozen → vertical-only, 'y' = Y frozen → horizontal-only) */
63
63
  lockAxis: 'x' | 'y' | null;
64
64
  /** Whether this is a keyboard-initiated drag */
65
65
  isKeyboardDrag: boolean;
@@ -124,13 +124,22 @@ interface DragEndEvent {
124
124
  draggableId: string;
125
125
  /** ID of the droppable container the item originated from */
126
126
  droppableId: string;
127
- /** Whether the drag was cancelled (escaped, dropped outside) */
127
+ /**
128
+ * Whether the drag was actively cancelled (Escape key). Releasing over no valid
129
+ * target (outside any droppable, or over a disabled droppable) is NOT a cancel —
130
+ * it reports `cancelled: false` with `destinationIndex: null`. Branch on
131
+ * `destinationIndex === null` to detect "no drop occurred".
132
+ */
128
133
  cancelled: boolean;
129
134
  /** Optional user-provided data associated with the item */
130
135
  data?: unknown;
131
136
  /** Original 0-indexed position in source list (for cancel announcements) */
132
137
  sourceIndex: number;
133
- /** Final 0-indexed position (null if cancelled) */
138
+ /**
139
+ * Final 0-indexed insertion position, or `null` when there is no valid drop target —
140
+ * a cancelled drag, a release outside every droppable, or a release over a disabled
141
+ * droppable. A non-null value pairs with a `DropEvent` on the destination.
142
+ */
134
143
  destinationIndex: number | null;
135
144
  }
136
145
  /**
@@ -317,6 +326,8 @@ declare class DragStateService {
317
326
  #private;
318
327
  /** Whether the last drag was cancelled (for droppable to check before emitting drop) */
319
328
  readonly wasCancelled: _angular_core.Signal<boolean>;
329
+ /** Snapshot captured synchronously before the last drag reset. */
330
+ readonly endedDragState: _angular_core.Signal<DragState | null>;
320
331
  /** Whether a drag operation is in progress */
321
332
  readonly isDragging: _angular_core.Signal<boolean>;
322
333
  /** The currently dragged item, or null */
@@ -430,6 +441,25 @@ declare class PositionCalculatorService {
430
441
  * scroll event has not yet fired but the container has already moved.
431
442
  */
432
443
  invalidateDroppableRects(): void;
444
+ /**
445
+ * Re-query the candidate droppable *list* for the active session and re-read their
446
+ * rects. Unlike {@link invalidateDroppableRects} (which only refreshes rects), this
447
+ * picks up droppables added or removed since the snapshot was captured at drag start —
448
+ * the frozen candidate list is otherwise blind to mid-drag mounts/unmounts.
449
+ *
450
+ * Safe to call when no session is active (no-op).
451
+ */
452
+ refreshCandidates(): void;
453
+ /**
454
+ * Signal that the set of droppables for `groupName` may have changed (a droppable
455
+ * registered or unregistered mid-drag). Defers the actual re-query to the next
456
+ * hit-test — where a removed element is already gone from the DOM and a newly added
457
+ * one has its data attributes applied — keeping this notification path cheap.
458
+ *
459
+ * Called by {@link DroppableDirective} lifecycle hooks. No-op when the active session
460
+ * belongs to a different group or no session is active.
461
+ */
462
+ notifyCandidatesChanged(groupName: string): void;
433
463
  /**
434
464
  * Find the droppable element at a given point.
435
465
  *
@@ -538,8 +568,14 @@ declare class PositionCalculatorService {
538
568
  findAdjacentDroppable(currentDroppableId: string, direction: 'left' | 'right', groupName: string): {
539
569
  element: HTMLElement;
540
570
  id: string;
541
- itemCount: number;
542
571
  } | null;
572
+ /**
573
+ * Whether the droppable with the given ID is currently disabled. A droppable that cannot
574
+ * be found is reported as disabled (treat missing as not a valid target). Used to
575
+ * revalidate a keyboard drag's active target at drop time, since it may have been disabled
576
+ * after the drag navigated into it.
577
+ */
578
+ isDroppableDisabledById(id: string): boolean;
543
579
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PositionCalculatorService, never>;
544
580
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PositionCalculatorService>;
545
581
  }
@@ -550,7 +586,7 @@ declare class PositionCalculatorService {
550
586
  interface AutoScrollConfig {
551
587
  /** Distance from edge to start scrolling (in pixels) */
552
588
  threshold: number;
553
- /** Maximum scroll speed (in pixels per frame) */
589
+ /** Maximum scroll speed in pixels per 60fps frame (about 16.67ms) */
554
590
  maxSpeed: number;
555
591
  /** Whether to accelerate scroll based on distance from edge */
556
592
  accelerate: boolean;
@@ -1285,7 +1321,12 @@ declare class DraggableDirective implements OnInit, OnDestroy {
1285
1321
  * Set to 0 for immediate drag (default behavior).
1286
1322
  */
1287
1323
  dragDelay: _angular_core.InputSignal<number>;
1288
- /** Lock dragging to a single axis ('x' = horizontal only, 'y' = vertical only) */
1324
+ /**
1325
+ * Lock dragging by freezing one axis. The value names the axis that stays
1326
+ * fixed: `'x'` freezes the X coordinate (vertical-only movement), `'y'`
1327
+ * freezes the Y coordinate (horizontal-only movement). `null` allows free
1328
+ * movement. Note: this is the opposite of Angular CDK's `cdkDragLockAxis`.
1329
+ */
1289
1330
  lockAxis: _angular_core.InputSignal<"x" | "y" | null>;
1290
1331
  /** Emits when drag starts */
1291
1332
  dragStart: _angular_core.OutputEmitterRef<DragStartEvent>;