svelte-dnd-action
Advanced tools
Comparing version 0.9.29 to 0.9.30
@@ -46,3 +46,3 @@ { | ||
"description": "*An awesome drag and drop library for Svelte 3 and 4 (not using the browser's built-in dnd, thanks god): Rich animations, nested containers, touch support and more *", | ||
"version": "0.9.29", | ||
"version": "0.9.30", | ||
"repository": { | ||
@@ -49,0 +49,0 @@ "type": "git", |
@@ -109,3 +109,3 @@ # SVELTE DND ACTION [![Known Vulnerabilities](https://snyk.io/test/github/isaacHagoel/svelte-dnd-action/badge.svg?targetFile=package.json)](https://snyk.io/test/github/isaacHagoel/svelte-dnd-action?targetFile=package.json) | ||
| `items` | Array<Object> | Yes. Each object in the array **has to have** an `id` property (key name can be overridden globally) with a unique value (within all dnd-zones of the same type) | N/A | The data array that is used to produce the list with the draggable items (the same thing you run your #each block on). The dndzone should not have children that don't originate in `items` | | ||
| `flipDurationMs` | Number | No | `0` | The same value you give the flip animation on the items (to make them animated as they "make space" for the dragged item). Set to zero or leave out if you don't want animations | | ||
| `flipDurationMs` | Number | No | `0` | The same value you give the flip animation on the items (to make them animated as they "make space" for the dragged item). Set to zero if you dont want animations, if unset it defaults to 100ms | | ||
| `type` | String | No | Internal | dnd-zones that share the same type can have elements from one dragged into another. By default, all dnd-zones have the same type | | ||
@@ -112,0 +112,0 @@ | `dragDisabled` | Boolean | No | `false` | Setting it to true will make it impossible to drag elements out of the dnd-zone. You can change it at any time, and the zone will adjust on the fly | |
@@ -39,2 +39,3 @@ import { | ||
const MIN_OBSERVATION_INTERVAL_MS = 100; | ||
const DISABLED_OBSERVATION_INTERVAL_MS = 20; | ||
const MIN_MOVEMENT_BEFORE_DRAG_START_PX = 3; | ||
@@ -100,6 +101,4 @@ const DEFAULT_DROP_TARGET_STYLE = { | ||
// it is important that we don't have an interval that is faster than the flip duration because it can cause elements to jump bach and forth | ||
const observationIntervalMs = Math.max( | ||
MIN_OBSERVATION_INTERVAL_MS, | ||
...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs) | ||
); | ||
const setIntervalMs = Math.max(...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs)); | ||
const observationIntervalMs = setIntervalMs === 0 ? DISABLED_OBSERVATION_INTERVAL_MS : Math.max(setIntervalMs, MIN_OBSERVATION_INTERVAL_MS); //if setintervalms is 0 it goes to 20, otherwise it is max between it and min observation. | ||
observe(draggedEl, dropZones, observationIntervalMs * 1.07); | ||
@@ -106,0 +105,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
290425
6785