ngx-virtual-dnd 3.2.0-alpha.1 → 3.2.0
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
|
@@ -351,13 +351,25 @@ interface VdndAnimationConfig {
|
|
|
351
351
|
* @default 'cubic-bezier(0.2, 0, 0, 1)'
|
|
352
352
|
*/
|
|
353
353
|
shiftEasing?: string;
|
|
354
|
+
/**
|
|
355
|
+
* Duration (ms) of the drop animation: on drop or cancel, the drag preview glides into
|
|
356
|
+
* the dropped item's final position instead of disappearing. `0` disables it.
|
|
357
|
+
* @default 200
|
|
358
|
+
*/
|
|
359
|
+
dropDuration?: number;
|
|
360
|
+
/**
|
|
361
|
+
* CSS easing function for the drop animation.
|
|
362
|
+
* @default 'cubic-bezier(0.2, 0, 0, 1)'
|
|
363
|
+
*/
|
|
364
|
+
dropEasing?: string;
|
|
354
365
|
}
|
|
355
366
|
/**
|
|
356
367
|
* Opt-in animation configuration. When provided, items displaced by the placeholder
|
|
357
|
-
* slide into their new position instead of jumping
|
|
368
|
+
* slide into their new position instead of jumping, and on drop the drag preview glides
|
|
369
|
+
* into the item's final position. Resolved through the element
|
|
358
370
|
* injector, so it can be provided app-wide or per component subtree.
|
|
359
371
|
*
|
|
360
|
-
*
|
|
372
|
+
* Animations are skipped when the user prefers reduced motion. Values are read each
|
|
361
373
|
* time an animation starts, so getters can toggle the animation at runtime.
|
|
362
374
|
*
|
|
363
375
|
* @example
|
|
@@ -994,6 +1006,9 @@ interface DragPreviewContext<T = unknown> {
|
|
|
994
1006
|
* so it works correctly even inside ancestors with CSS `transform` (e.g. Ionic pages).
|
|
995
1007
|
* It can be placed anywhere in the component tree.
|
|
996
1008
|
*
|
|
1009
|
+
* When `VDND_ANIMATION_CONFIG` is provided, the preview stays up briefly after a drop or
|
|
1010
|
+
* cancel and glides into the item's final position.
|
|
1011
|
+
*
|
|
997
1012
|
* @example
|
|
998
1013
|
* ```html
|
|
999
1014
|
* <vdnd-drag-preview>
|
|
@@ -1015,6 +1030,12 @@ declare class DragPreviewComponent<T = unknown> implements OnDestroy {
|
|
|
1015
1030
|
}>;
|
|
1016
1031
|
/** Reference to the clone container element (cannot use ES private with viewChild) */
|
|
1017
1032
|
private readonly cloneContainer;
|
|
1033
|
+
/** The rendered preview box (cannot use ES private with viewChild) */
|
|
1034
|
+
private readonly previewElement;
|
|
1035
|
+
/** Whether the preview is playing the drop animation */
|
|
1036
|
+
protected readonly isSettling: _angular_core.Signal<boolean>;
|
|
1037
|
+
/** The item shown: the live dragged item, or the dropped one while it settles */
|
|
1038
|
+
protected readonly displayedItem: _angular_core.Signal<DraggedItem | null>;
|
|
1018
1039
|
/** The cloned element from drag state (used when no custom template is provided) */
|
|
1019
1040
|
protected readonly clonedElement: _angular_core.Signal<HTMLElement | null>;
|
|
1020
1041
|
constructor();
|
|
@@ -1022,10 +1043,7 @@ declare class DragPreviewComponent<T = unknown> implements OnDestroy {
|
|
|
1022
1043
|
/** Whether the preview is visible */
|
|
1023
1044
|
protected readonly isVisible: _angular_core.Signal<boolean>;
|
|
1024
1045
|
/** Position of the preview */
|
|
1025
|
-
protected readonly position: _angular_core.Signal<
|
|
1026
|
-
x: number;
|
|
1027
|
-
y: number;
|
|
1028
|
-
}>;
|
|
1046
|
+
protected readonly position: _angular_core.Signal<CursorPosition>;
|
|
1029
1047
|
/** Transform-based positioning for better performance (avoid layout from left/top). */
|
|
1030
1048
|
protected readonly transform: _angular_core.Signal<string>;
|
|
1031
1049
|
/** Dimensions of the preview */
|