svelte-movable
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -161,2 +161,3 @@ import { input } from './utils'; | ||
const onMouseDown = (event) => { | ||
var _a, _b, _c, _d; | ||
node.dispatchEvent(new CustomEvent('movablestart', { detail: node })); | ||
@@ -166,4 +167,4 @@ const computedStyles = getComputedStyle(node); | ||
const regex = '^[-0-9]+'; | ||
const left = parseInt(computedStyles.getPropertyValue('left').match(regex)?.[0] ?? '0'); | ||
const top = parseInt(computedStyles.getPropertyValue('top').match(regex)?.[0] ?? '0'); | ||
const left = parseInt((_b = (_a = computedStyles.getPropertyValue('left').match(regex)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '0'); | ||
const top = parseInt((_d = (_c = computedStyles.getPropertyValue('top').match(regex)) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : '0'); | ||
updateLastNodeCoordinates({ left, top }); | ||
@@ -170,0 +171,0 @@ // init position style |
@@ -11,10 +11,11 @@ import { normalizeDelta } from '../normalizeDelta'; | ||
export function input(node, parameters) { | ||
var _a, _b, _c, _d, _e; | ||
return { | ||
enabled: parameters.enabled ?? true, | ||
parent: parameters.limit?.parent, | ||
normalizedDelta: normalizeDelta(parameters.limit?.delta), | ||
cache: parameters.cache ?? 'none', | ||
trigger: parameters.trigger ?? node, | ||
enabled: (_a = parameters.enabled) !== null && _a !== void 0 ? _a : true, | ||
parent: (_b = parameters.limit) === null || _b === void 0 ? void 0 : _b.parent, | ||
normalizedDelta: normalizeDelta((_c = parameters.limit) === null || _c === void 0 ? void 0 : _c.delta), | ||
cache: (_d = parameters.cache) !== null && _d !== void 0 ? _d : 'none', | ||
trigger: (_e = parameters.trigger) !== null && _e !== void 0 ? _e : node, | ||
}; | ||
} | ||
//# sourceMappingURL=input.js.map |
@@ -13,3 +13,3 @@ /** | ||
if (unit !== '%' && unit !== 'px') { | ||
throw new Error(`Invalid delta ${axis ?? ''} unit. Only 'px' and '%' are supported.`); | ||
throw new Error(`Invalid delta ${axis !== null && axis !== void 0 ? axis : ''} unit. Only 'px' and '%' are supported.`); | ||
} | ||
@@ -16,0 +16,0 @@ return unit; |
{ | ||
"name": "svelte-movable", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Action to move node on mousedown", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
34232
499