@uxpin/html-dnd
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -9,3 +9,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
"use strict"; | ||
function simulate(draggable, droppable, dndSimulateConfig) { | ||
function simulate(draggable, droppable, dndSimulateConfig, middleStep) { | ||
var _a = calculateMousePositions(draggable, droppable, dndSimulateConfig), dragX = _a.dragX, dragY = _a.dragY, dropX = _a.dropX, dropY = _a.dropY; | ||
@@ -22,2 +22,6 @@ var store = new DragDataStore(); | ||
setTimeout(function () { | ||
if (middleStep) { | ||
var dragOverEventMiddleStep = createEventWithDataTransfer("dragover", dataTransfer, 0, 0, 0, dropX, dropY, false, false, false, false, 0, null); | ||
middleStep.dispatchEvent(dragOverEventMiddleStep); | ||
} | ||
var dragOverEvent = createEventWithDataTransfer("dragover", dataTransfer, 0, 0, 0, dropX, dropY, false, false, false, false, 0, null); | ||
@@ -24,0 +28,0 @@ droppable.dispatchEvent(dragOverEvent); |
@@ -19,4 +19,5 @@ var util = require('util'); | ||
var droppable = document.querySelector(selectorDroppable); | ||
var middleStep = dndSimulateConfig.middleStep ? document.querySelector(dndSimulateConfig.middleStep) : null; | ||
dnd.simulate(draggable, droppable, dndSimulateConfig); | ||
dnd.simulate(draggable, droppable, dndSimulateConfig, middleStep); | ||
})(arguments[0], arguments[1], arguments[2]);`, coreCode); | ||
@@ -23,0 +24,0 @@ |
{ | ||
"name": "@uxpin/html-dnd", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "HTML Drag and Drop Simulator for E2E testing", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -9,3 +9,3 @@ namespace dnd { | ||
export function simulate(draggable: Element, droppable: Element, dndSimulateConfig: DndSimulateConfig): void { | ||
export function simulate(draggable: Element, droppable: Element, dndSimulateConfig: DndSimulateConfig, middleStep?:Element): void { | ||
const {dragX, dragY, dropX, dropY} = calculateMousePositions(draggable, droppable, dndSimulateConfig); | ||
@@ -27,2 +27,7 @@ | ||
setTimeout(function() { | ||
if (middleStep) { | ||
const dragOverEventMiddleStep = createEventWithDataTransfer("dragover", dataTransfer, 0, 0, 0, dropX, dropY, false, false, false, false, 0, null); | ||
middleStep.dispatchEvent(dragOverEventMiddleStep); | ||
} | ||
const dragOverEvent = createEventWithDataTransfer("dragover", dataTransfer, 0, 0, 0, dropX, dropY, false, false, false, false, 0, null); | ||
@@ -29,0 +34,0 @@ droppable.dispatchEvent(dragOverEvent); |
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
203280
1157