Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-swipeout

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-swipeout - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

1

es/Swipeout.d.ts

@@ -24,2 +24,3 @@ /// <reference types="react" />

panStartX: number;
panStartY: number;
constructor(props: any);

@@ -26,0 +27,0 @@ componentDidMount(): void;

19

es/Swipeout.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc