ngx-virtual-dnd 1.2.2 → 1.2.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": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "A performant drag-and-drop library for Angular that works seamlessly with virtual scrolling",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InjectionToken, OnInit, AfterViewInit, OnDestroy, TemplateRef, Signal, WritableSignal } from '@angular/core';
2
+ import { InjectionToken, OnDestroy, OnInit, AfterViewInit, TemplateRef, Signal, WritableSignal } from '@angular/core';
3
3
 
4
4
  /**
5
5
  * Represents the item currently being dragged.
@@ -572,6 +572,28 @@ declare class KeyboardDragService {
572
572
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<KeyboardDragService>;
573
573
  }
574
574
 
575
+ /**
576
+ * Service that manages a shared overlay container appended to `document.body`.
577
+ *
578
+ * Elements placed inside the overlay container escape any ancestor CSS `transform`,
579
+ * `perspective`, or `filter` that would create a new containing block for
580
+ * `position: fixed` children. This ensures viewport-relative positioning works
581
+ * correctly regardless of where the consuming component sits in the DOM tree.
582
+ *
583
+ * Mirrors the strategy used by Angular CDK's `OverlayContainer`.
584
+ */
585
+ declare class OverlayContainerService implements OnDestroy {
586
+ #private;
587
+ /**
588
+ * Returns the shared overlay container element, lazily creating it on first access.
589
+ * Returns `null` in non-browser environments (SSR).
590
+ */
591
+ getContainerElement(): HTMLElement | null;
592
+ ngOnDestroy(): void;
593
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<OverlayContainerService, never>;
594
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<OverlayContainerService>;
595
+ }
596
+
575
597
  /**
576
598
  * Context provided to the item template.
577
599
  */
@@ -753,8 +775,9 @@ interface DragPreviewContext<T = unknown> {
753
775
  /**
754
776
  * Renders a preview of the dragged item that follows the cursor.
755
777
  *
756
- * This component should be placed at the root of your application (or at least
757
- * outside of any scrollable containers) to ensure the preview is always visible.
778
+ * The component automatically teleports itself into a body-level overlay container,
779
+ * so it works correctly even inside ancestors with CSS `transform` (e.g. Ionic pages).
780
+ * It can be placed anywhere in the component tree.
758
781
  *
759
782
  * @example
760
783
  * ```html
@@ -765,7 +788,8 @@ interface DragPreviewContext<T = unknown> {
765
788
  * </vdnd-drag-preview>
766
789
  * ```
767
790
  */
768
- declare class DragPreviewComponent<T = unknown> {
791
+ declare class DragPreviewComponent<T = unknown> implements OnDestroy {
792
+ #private;
769
793
  protected readonly dragState: DragStateService;
770
794
  /** Optional custom template for the preview */
771
795
  previewTemplate: _angular_core.InputSignal<TemplateRef<DragPreviewContext<T>> | undefined>;
@@ -779,6 +803,7 @@ declare class DragPreviewComponent<T = unknown> {
779
803
  /** The cloned element from drag state (used when no custom template is provided) */
780
804
  protected readonly clonedElement: _angular_core.Signal<HTMLElement | null>;
781
805
  constructor();
806
+ ngOnDestroy(): void;
782
807
  /** Whether the preview is visible */
783
808
  protected readonly isVisible: _angular_core.Signal<boolean>;
784
809
  /** Position of the preview */
@@ -1232,6 +1257,10 @@ declare class DroppableDirective implements OnInit, OnDestroy {
1232
1257
  * Optional when a parent `vdndGroup` directive provides the group context.
1233
1258
  */
1234
1259
  vdndDroppableGroup: _angular_core.InputSignal<string | undefined>;
1260
+ /**
1261
+ * Resolved group name - uses explicit input or falls back to parent group.
1262
+ * Returns null (and disables dropping) if neither is available.
1263
+ */
1235
1264
  readonly effectiveGroup: _angular_core.Signal<string | null>;
1236
1265
  /** Optional data associated with this droppable */
1237
1266
  vdndDroppableData: _angular_core.InputSignal<unknown>;
@@ -1544,5 +1573,5 @@ declare function insertAt<T>(list: T[], item: T, index: number): T[];
1544
1573
  */
1545
1574
  declare function removeAt<T>(list: T[], index: number): T[];
1546
1575
 
1547
- export { AutoScrollService, DragPlaceholderComponent, DragPreviewComponent, DragStateService, DraggableDirective, DroppableDirective, DroppableGroupDirective, END_OF_LIST, ElementCloneService, INITIAL_DRAG_STATE, KeyboardDragService, PlaceholderComponent, PositionCalculatorService, ScrollableDirective, VDND_GROUP_TOKEN, VDND_SCROLL_CONTAINER, VDND_VIRTUAL_VIEWPORT, VirtualContentComponent, VirtualForDirective, VirtualScrollContainerComponent, VirtualSortableListComponent, VirtualViewportComponent, applyMove, insertAt, isNoOpDrop, moveItem, removeAt, reorderItems };
1576
+ export { AutoScrollService, DragPlaceholderComponent, DragPreviewComponent, DragStateService, DraggableDirective, DroppableDirective, DroppableGroupDirective, END_OF_LIST, ElementCloneService, INITIAL_DRAG_STATE, KeyboardDragService, OverlayContainerService, PlaceholderComponent, PositionCalculatorService, ScrollableDirective, VDND_GROUP_TOKEN, VDND_SCROLL_CONTAINER, VDND_VIRTUAL_VIEWPORT, VirtualContentComponent, VirtualForDirective, VirtualScrollContainerComponent, VirtualSortableListComponent, VirtualViewportComponent, applyMove, insertAt, isNoOpDrop, moveItem, removeAt, reorderItems };
1548
1577
  export type { AutoScrollConfig, CursorPosition, DragEndEvent, DragEnterEvent, DragLeaveEvent, DragMoveEvent, DragOverEvent, DragPreviewContext, DragStartEvent, DragState, DraggedItem, DropDestination, DropEvent, DropSource, GrabOffset, PlaceholderContext, VdndGroupContext, VdndScrollContainer, VdndVirtualViewport, VirtualForContext, VirtualScrollItemContext, VisibleRangeChange };