rax-gesture-view
Advanced tools
Comparing version 1.1.0-0 to 1.1.0
@@ -16,20 +16,12 @@ "use strict"; | ||
var threshold = 5; | ||
var touchActionRatio = 1 / 1; | ||
var GestureViewOnWeb = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
var GestureViewOnWeb = /*#__PURE__*/function (_Component) { | ||
_inheritsLoose(GestureViewOnWeb, _Component); | ||
function GestureViewOnWeb() { | ||
var _this; | ||
var _this = _Component.apply(this, arguments) || this; | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _Component.call.apply(_Component, [this].concat(args)) || this; | ||
_this.startX = undefined; | ||
_this.startY = undefined; | ||
_this.startX = 0; | ||
_this.startY = 0; | ||
_this.isStartX = false; | ||
@@ -39,3 +31,3 @@ _this.isStartY = false; | ||
_this.maxDx = 0; | ||
_this.panType = void 0; | ||
_this.panType = 'x'; | ||
@@ -50,3 +42,5 @@ _this.onTouchStart = function (e) { | ||
onHorizontalPan = _this$props.onHorizontalPan, | ||
onVerticalPan = _this$props.onVerticalPan; | ||
onVerticalPan = _this$props.onVerticalPan, | ||
_this$props$threshold = _this$props.threshold, | ||
threshold = _this$props$threshold === void 0 ? 5 : _this$props$threshold; | ||
var deltaX = e.changedTouches[0].clientX - _this.startX; | ||
@@ -62,3 +56,3 @@ var deltaY = e.changedTouches[0].clientY - _this.startY; | ||
if (onHorizontalPan && Math.abs(deltaX) >= threshold && Math.abs(deltaY / deltaX) < touchActionRatio && Math.abs(_this.maxDy) < threshold) { | ||
if (onHorizontalPan && Math.abs(deltaX) >= threshold && Math.abs(deltaY / deltaX) < touchActionRatio) { | ||
e.preventDefault(); | ||
@@ -78,3 +72,3 @@ _this.isPropagationStoppedX = true; | ||
onHorizontalPan && onHorizontalPan(e); | ||
} else if (onVerticalPan && Math.abs(deltaY) >= threshold && Math.abs(deltaX / deltaY) < touchActionRatio && Math.abs(_this.maxDx) < threshold) { | ||
} else if (onVerticalPan && Math.abs(deltaY) >= threshold && Math.abs(deltaX / deltaY) < touchActionRatio) { | ||
e.preventDefault(); | ||
@@ -143,3 +137,3 @@ _this.isPropagationStoppedY = true; | ||
this.isStartY = false; | ||
this.panType = undefined; | ||
this.panType = 'x'; | ||
this.isPropagationStoppedX = false; | ||
@@ -146,0 +140,0 @@ this.isPropagationStoppedY = false; |
@@ -16,16 +16,10 @@ "use strict"; | ||
var GestureViewOnWeex = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
var GestureViewOnWeex = /*#__PURE__*/function (_Component) { | ||
_inheritsLoose(GestureViewOnWeex, _Component); | ||
function GestureViewOnWeex() { | ||
var _this; | ||
var _this = _Component.apply(this, arguments) || this; | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this.startX = 0; | ||
_this = _Component.call.apply(_Component, [this].concat(args)) || this; | ||
_this.onTouchStart = function (e) { | ||
@@ -32,0 +26,0 @@ _this.startX = e.changedTouches[0].clientX; |
@@ -20,3 +20,3 @@ "use strict"; | ||
}, | ||
didMount: function didMount() {}, | ||
didMount: function () {}, | ||
methods: { | ||
@@ -23,0 +23,0 @@ onTouchStart: function onTouchStart(e) { |
{ | ||
"name": "rax-gesture-view", | ||
"version": "1.1.0-0", | ||
"version": "1.1.0", | ||
"description": "Gesture component for Rax.", | ||
@@ -9,8 +9,5 @@ "license": "BSD-3-Clause", | ||
"clean": "rm -rf ./lib && rm -rf ./package-lock.json", | ||
"build": "npm run clean && rax-scripts build --type 'component'", | ||
"start": "rax-scripts start --type 'component' -p 8000", | ||
"prepublishOnly": "npm run build", | ||
"test": "npm run build && rax-scripts test", | ||
"lint": "eslint --ext .js --ext .jsx --ext .ts --ext .tsx ./src", | ||
"miniapp": "rax-scripts start --type 'component-miniapp'" | ||
"build": "npm run clean && ../../node_modules/.bin/build-scripts build --config ../../build.json", | ||
"start": "../../node_modules/.bin/build-scripts start --config ../../build.json", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -23,3 +20,3 @@ "files": [ | ||
"type": "git", | ||
"url": "git+https://github.com/raxjs/rax-gesture-view.git" | ||
"url": "git+https://github.com/raxjs/rax-components.git" | ||
}, | ||
@@ -39,10 +36,12 @@ "keywords": [ | ||
"dependencies": { | ||
"rax-view": "^1.1.0-0", | ||
"universal-env": "^1.0.0" | ||
"rax-types": "^1.0.0", | ||
"rax-view": "^1.1.0", | ||
"universal-env": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"rax": "^1.0.0" | ||
"rax": "^1.0.0", | ||
"rax-types": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@rax-types/rax": "^1.0.5", | ||
"@types/rax": "^1.0.0", | ||
"@types/ali-app": "^1.0.0", | ||
@@ -53,10 +52,8 @@ "@types/jest": "^24.0.12", | ||
"csstype": "^2.6.4", | ||
"driver-dom": "^1.0.0", | ||
"driver-universal": "^1.0.0", | ||
"driver-weex": "^1.0.0", | ||
"driver-universal": "^1.0.2", | ||
"eslint": "^5.16.0", | ||
"eslint-config-rax": "^0.0.0", | ||
"rax": "^1.0.0", | ||
"rax-scripts": "1.2.1", | ||
"rax-test-renderer": "^1.0.0" | ||
"rax-test-renderer": "^1.0.0", | ||
"rax-text": "^1.1.6" | ||
}, | ||
@@ -63,0 +60,0 @@ "miniappConfig": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12
16
0
0
15716
5
310
+ Addedrax-types@^1.0.0
+ Added@types/prop-types@15.7.14(transitive)
+ Addedcsstype@2.6.21(transitive)
+ Addedrax-types@1.0.1(transitive)
- Removeduniversal-env@1.0.7(transitive)
Updatedrax-view@^1.1.0
Updateduniversal-env@^3.0.0