@dflex/draggable
Advanced tools
Comparing version 3.1.0 to 3.2.0
import type { AbstractCoreInterface } from "@dflex/core-instance"; | ||
import { AxesCoordinates } from "@dflex/utils"; | ||
import type { AbstractDraggableInterface, DraggedStyle, Coordinates } from "./types"; | ||
@@ -15,5 +16,4 @@ declare class AbstractDraggable<T extends AbstractCoreInterface> implements AbstractDraggableInterface<T> { | ||
*/ | ||
outerOffsetX: number; | ||
outerOffsetY: number; | ||
tempTranslate: Coordinates; | ||
outerOffset: AxesCoordinates; | ||
translatePlaceholder: AxesCoordinates; | ||
static draggedStyle: DraggedStyle; | ||
@@ -20,0 +20,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("@dflex/utils"); | ||
var AbstractDraggable = /** @class */ (function () { | ||
@@ -18,8 +19,4 @@ /** | ||
var translate = this.draggedElm.translate; | ||
this.outerOffsetX = -initX + translate.x; | ||
this.outerOffsetY = -initY + translate.y; | ||
this.tempTranslate = { | ||
x: 0, | ||
y: 0, | ||
}; | ||
this.outerOffset = new utils_1.AxesCoordinates(-initX + translate.x, -initY + translate.y); | ||
this.translatePlaceholder = new utils_1.AxesCoordinates(0, 0); | ||
this.setDragged(true); | ||
@@ -57,3 +54,3 @@ } | ||
} | ||
this.draggedElm.ref.setAttribute("dragged", "true"); | ||
this.draggedElm.setAttribute("dragged", "true"); | ||
return; | ||
@@ -65,3 +62,3 @@ } | ||
this.changeStyle(AbstractDraggable.draggedStyle, false); | ||
this.draggedElm.ref.removeAttribute("dragged"); | ||
this.draggedElm.clearAttributes(); | ||
}; | ||
@@ -84,5 +81,4 @@ /** | ||
*/ | ||
this.tempTranslate.x = x + this.outerOffsetX; | ||
this.tempTranslate.y = y + this.outerOffsetY; | ||
this.draggedElm.ref.style.transform = "translate3d(".concat(this.tempTranslate.x, "px,").concat(this.tempTranslate.y, "px, 0)"); | ||
this.translatePlaceholder.setAxes(x + this.outerOffset.x, y + this.outerOffset.y); | ||
this.draggedElm.transform(this.translatePlaceholder.x, this.translatePlaceholder.y); | ||
}; | ||
@@ -89,0 +85,0 @@ AbstractDraggable.draggedStyle = [ |
@@ -43,4 +43,3 @@ "use strict"; | ||
this.translate(x, y); | ||
this.draggedElm.translate.x = this.tempTranslate.x; | ||
this.draggedElm.translate.y = this.tempTranslate.y; | ||
this.draggedElm.translate.clone(this.translatePlaceholder); | ||
}; | ||
@@ -47,0 +46,0 @@ Draggable.prototype.endDragging = function () { |
import type { AbstractCoreInterface } from "@dflex/core-instance"; | ||
import { AxesCoordinates } from "@dflex/utils"; | ||
export interface Coordinates { | ||
@@ -36,7 +37,6 @@ x: number; | ||
*/ | ||
outerOffsetX: number; | ||
outerOffsetY: number; | ||
tempTranslate: Coordinates; | ||
outerOffset: AxesCoordinates; | ||
translatePlaceholder: AxesCoordinates; | ||
changeStyle(style: DraggedStyle, shouldAddPosition: boolean): void; | ||
} | ||
export {}; |
{ | ||
"name": "@dflex/draggable", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"main": "dist/index.js", | ||
@@ -9,4 +9,7 @@ "types": "dist/index.d.ts", | ||
"scripts": { | ||
"compile": "yarn rimraf ./dist tsconfig.tsbuildinfo && yarn tsc -b", | ||
"build": "yarn compile", | ||
"clean": "yarn rimraf ./dist *.tsbuildinfo", | ||
"compile": "yarn tsc -b", | ||
"compile:w": "yarn tsc -b -w", | ||
"build": "yarn clean && yarn compile", | ||
"dev": "yarn workspace dflex-react-draggable start", | ||
"test": "jest" | ||
@@ -22,4 +25,5 @@ }, | ||
"dependencies": { | ||
"@dflex/core-instance": "^3.1.0", | ||
"@dflex/store": "^3.1.0" | ||
"@dflex/core-instance": "^3.2.0", | ||
"@dflex/store": "^3.2.0", | ||
"@dflex/utils": "^3.2.0" | ||
}, | ||
@@ -46,3 +50,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "eac9f58fd4893166f1db260bc01a99fa8b641af3" | ||
"gitHead": "d3f7e38aaa516064984ac17dcfe8db6b0d099a5e" | ||
} |
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
18615
3
349
+ Added@dflex/utils@^3.2.0
+ Added@dflex/utils@3.10.6(transitive)
Updated@dflex/core-instance@^3.2.0
Updated@dflex/store@^3.2.0