rc-swipeout
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -24,2 +24,3 @@ /// <reference types="react" /> | ||
panStartX: number; | ||
panStartY: number; | ||
constructor(props: any); | ||
@@ -26,0 +27,0 @@ componentDidMount(): void; |
@@ -75,2 +75,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
this.panStartX = e.deltaX; | ||
this.panStartY = e.deltaY; | ||
} | ||
@@ -80,3 +81,5 @@ }, { | ||
value: function onPan(e) { | ||
if (this.props.disabled) { | ||
var posX = e.deltaX - this.panStartX; | ||
var posY = e.deltaY - this.panStartY; | ||
if (this.props.disabled || Math.abs(posX) <= Math.abs(posY)) { | ||
return; | ||
@@ -90,3 +93,2 @@ } | ||
var posX = e.deltaX - this.panStartX; | ||
if (posX < 0 && right.length) { | ||
@@ -101,3 +103,5 @@ this._setStyle(Math.min(posX, 0)); | ||
value: function onPanEnd(e) { | ||
if (this.props.disabled) { | ||
var posX = e.deltaX - this.panStartX; | ||
var posY = e.deltaY - this.panStartY; | ||
if (this.props.disabled || Math.abs(posX) <= Math.abs(posY)) { | ||
return; | ||
@@ -111,3 +115,2 @@ } | ||
var posX = e.deltaX - this.panStartX; | ||
var btnsLeftWidth = this.btnsLeftWidth; | ||
@@ -154,8 +157,2 @@ var btnsRightWidth = this.btnsRightWidth; | ||
value: function _setStyle(value) { | ||
var _props3 = this.props, | ||
_props3$left = _props3.left, | ||
left = _props3$left === undefined ? [] : _props3$left, | ||
_props3$right = _props3.right, | ||
right = _props3$right === undefined ? [] : _props3$right; | ||
var limit = value > 0 ? this.btnsLeftWidth : -this.btnsRightWidth; | ||
@@ -208,3 +205,3 @@ var contentLeft = this._getContentEasing(value, limit); | ||
'div', | ||
{ className: prefixCls + '-text' }, | ||
{ className: prefixCls + '-btn-text' }, | ||
btn.text || 'Click' | ||
@@ -211,0 +208,0 @@ ) |
# History | ||
# 1.4.1 | ||
- improve: disabled swipe if deltaX < deltaY | ||
# 1.4.0 | ||
@@ -4,0 +8,0 @@ |
@@ -24,2 +24,3 @@ /// <reference types="react" /> | ||
panStartX: number; | ||
panStartY: number; | ||
constructor(props: any); | ||
@@ -26,0 +27,0 @@ componentDidMount(): void; |
@@ -110,2 +110,3 @@ 'use strict'; | ||
this.panStartX = e.deltaX; | ||
this.panStartY = e.deltaY; | ||
} | ||
@@ -115,3 +116,5 @@ }, { | ||
value: function onPan(e) { | ||
if (this.props.disabled) { | ||
var posX = e.deltaX - this.panStartX; | ||
var posY = e.deltaY - this.panStartY; | ||
if (this.props.disabled || Math.abs(posX) <= Math.abs(posY)) { | ||
return; | ||
@@ -125,3 +128,2 @@ } | ||
var posX = e.deltaX - this.panStartX; | ||
if (posX < 0 && right.length) { | ||
@@ -136,3 +138,5 @@ this._setStyle(Math.min(posX, 0)); | ||
value: function onPanEnd(e) { | ||
if (this.props.disabled) { | ||
var posX = e.deltaX - this.panStartX; | ||
var posY = e.deltaY - this.panStartY; | ||
if (this.props.disabled || Math.abs(posX) <= Math.abs(posY)) { | ||
return; | ||
@@ -146,3 +150,2 @@ } | ||
var posX = e.deltaX - this.panStartX; | ||
var btnsLeftWidth = this.btnsLeftWidth; | ||
@@ -189,8 +192,2 @@ var btnsRightWidth = this.btnsRightWidth; | ||
value: function _setStyle(value) { | ||
var _props3 = this.props, | ||
_props3$left = _props3.left, | ||
left = _props3$left === undefined ? [] : _props3$left, | ||
_props3$right = _props3.right, | ||
right = _props3$right === undefined ? [] : _props3$right; | ||
var limit = value > 0 ? this.btnsLeftWidth : -this.btnsRightWidth; | ||
@@ -243,3 +240,3 @@ var contentLeft = this._getContentEasing(value, limit); | ||
'div', | ||
{ className: prefixCls + '-text' }, | ||
{ className: prefixCls + '-btn-text' }, | ||
btn.text || 'Click' | ||
@@ -246,0 +243,0 @@ ) |
{ | ||
"name": "rc-swipeout", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "swipe out ui component for react(web and react-native)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
41991
961