Socket
Socket
Sign inDemoInstall

react-swipeable-list

Package Overview
Dependencies
0
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.0 to 1.7.0

6

dist/module.d.ts

@@ -125,2 +125,8 @@ import {

/**
* default: 0
*
* Time in milliseconds after which swipe action and animation should be called after trigggering swipe action.
*/
actionDelay?: number;
/**
* default: `false`

@@ -127,0 +133,0 @@ *

20

dist/react-swipeable-list.cjs.js

@@ -83,3 +83,5 @@ 'use strict';

var SwipeableList = function SwipeableList(_ref) {
var children = _ref.children,
var _ref$actionDelay = _ref.actionDelay,
actionDelay = _ref$actionDelay === void 0 ? 0 : _ref$actionDelay,
children = _ref.children,
_ref$className = _ref.className,

@@ -105,2 +107,3 @@ className = _ref$className === void 0 ? '' : _ref$className,

return /*#__PURE__*/React__default["default"].cloneElement(child, {
actionDelay: actionDelay,
destructiveCallbackDelay: destructiveCallbackDelay,

@@ -117,2 +120,3 @@ fullSwipe: fullSwipe,

SwipeableList.propTypes = {
actionDelay: PropTypes__default["default"].number,
children: PropTypes__default["default"].node,

@@ -852,2 +856,3 @@ className: PropTypes__default["default"].string,

var _this$props2 = _this.props,
actionDelay = _this$props2.actionDelay,
destructiveCallbackDelay = _this$props2.destructiveCallbackDelay,

@@ -873,2 +878,3 @@ listType = _this$props2.listType;

value: {
actionDelay: actionDelay,
destructiveCallbackDelay: destructiveCallbackDelay,

@@ -1003,2 +1009,3 @@ listType: listType,

SwipeableListItem.propTypes = {
actionDelay: PropTypes__default["default"].number,
blockSwipe: PropTypes__default["default"].bool,

@@ -1035,2 +1042,3 @@ children: PropTypes__default["default"].node,

var _React$useContext = React__default["default"].useContext(ItemContext),
actionDelay = _React$useContext.actionDelay,
destructiveCallbackDelay = _React$useContext.destructiveCallbackDelay,

@@ -1047,2 +1055,10 @@ leadingFullSwipe = _React$useContext.leadingFullSwipe,

var onHandleClick = React__default["default"].useCallback(function () {
if (actionDelay) {
window.setTimeout(function () {
onActionTriggered(destructive);
onClick();
}, actionDelay);
return;
}
onActionTriggered(destructive);

@@ -1057,3 +1073,3 @@

}
}, [destructive, destructiveCallbackDelay, onActionTriggered, onClick]);
}, [actionDelay, destructive, destructiveCallbackDelay, onActionTriggered, onClick]);
React__default["default"].useEffect(function () {

@@ -1060,0 +1076,0 @@ if (leading && main) {

@@ -74,3 +74,5 @@ import React, { PureComponent } from 'react';

var SwipeableList = function SwipeableList(_ref) {
var children = _ref.children,
var _ref$actionDelay = _ref.actionDelay,
actionDelay = _ref$actionDelay === void 0 ? 0 : _ref$actionDelay,
children = _ref.children,
_ref$className = _ref.className,

@@ -96,2 +98,3 @@ className = _ref$className === void 0 ? '' : _ref$className,

return /*#__PURE__*/React.cloneElement(child, {
actionDelay: actionDelay,
destructiveCallbackDelay: destructiveCallbackDelay,

@@ -108,2 +111,3 @@ fullSwipe: fullSwipe,

SwipeableList.propTypes = {
actionDelay: PropTypes.number,
children: PropTypes.node,

@@ -843,2 +847,3 @@ className: PropTypes.string,

var _this$props2 = _this.props,
actionDelay = _this$props2.actionDelay,
destructiveCallbackDelay = _this$props2.destructiveCallbackDelay,

@@ -864,2 +869,3 @@ listType = _this$props2.listType;

value: {
actionDelay: actionDelay,
destructiveCallbackDelay: destructiveCallbackDelay,

@@ -994,2 +1000,3 @@ listType: listType,

SwipeableListItem.propTypes = {
actionDelay: PropTypes.number,
blockSwipe: PropTypes.bool,

@@ -1026,2 +1033,3 @@ children: PropTypes.node,

var _React$useContext = React.useContext(ItemContext),
actionDelay = _React$useContext.actionDelay,
destructiveCallbackDelay = _React$useContext.destructiveCallbackDelay,

@@ -1038,2 +1046,10 @@ leadingFullSwipe = _React$useContext.leadingFullSwipe,

var onHandleClick = React.useCallback(function () {
if (actionDelay) {
window.setTimeout(function () {
onActionTriggered(destructive);
onClick();
}, actionDelay);
return;
}
onActionTriggered(destructive);

@@ -1048,3 +1064,3 @@

}
}, [destructive, destructiveCallbackDelay, onActionTriggered, onClick]);
}, [actionDelay, destructive, destructiveCallbackDelay, onActionTriggered, onClick]);
React.useEffect(function () {

@@ -1051,0 +1067,0 @@ if (leading && main) {

@@ -82,3 +82,5 @@ (function (global, factory) {

var SwipeableList = function SwipeableList(_ref) {
var children = _ref.children,
var _ref$actionDelay = _ref.actionDelay,
actionDelay = _ref$actionDelay === void 0 ? 0 : _ref$actionDelay,
children = _ref.children,
_ref$className = _ref.className,

@@ -104,2 +106,3 @@ className = _ref$className === void 0 ? '' : _ref$className,

return /*#__PURE__*/React__default["default"].cloneElement(child, {
actionDelay: actionDelay,
destructiveCallbackDelay: destructiveCallbackDelay,

@@ -116,2 +119,3 @@ fullSwipe: fullSwipe,

SwipeableList.propTypes = {
actionDelay: PropTypes__default["default"].number,
children: PropTypes__default["default"].node,

@@ -851,2 +855,3 @@ className: PropTypes__default["default"].string,

var _this$props2 = _this.props,
actionDelay = _this$props2.actionDelay,
destructiveCallbackDelay = _this$props2.destructiveCallbackDelay,

@@ -872,2 +877,3 @@ listType = _this$props2.listType;

value: {
actionDelay: actionDelay,
destructiveCallbackDelay: destructiveCallbackDelay,

@@ -1002,2 +1008,3 @@ listType: listType,

SwipeableListItem.propTypes = {
actionDelay: PropTypes__default["default"].number,
blockSwipe: PropTypes__default["default"].bool,

@@ -1034,2 +1041,3 @@ children: PropTypes__default["default"].node,

var _React$useContext = React__default["default"].useContext(ItemContext),
actionDelay = _React$useContext.actionDelay,
destructiveCallbackDelay = _React$useContext.destructiveCallbackDelay,

@@ -1046,2 +1054,10 @@ leadingFullSwipe = _React$useContext.leadingFullSwipe,

var onHandleClick = React__default["default"].useCallback(function () {
if (actionDelay) {
window.setTimeout(function () {
onActionTriggered(destructive);
onClick();
}, actionDelay);
return;
}
onActionTriggered(destructive);

@@ -1056,3 +1072,3 @@

}
}, [destructive, destructiveCallbackDelay, onActionTriggered, onClick]);
}, [actionDelay, destructive, destructiveCallbackDelay, onActionTriggered, onClick]);
React__default["default"].useEffect(function () {

@@ -1059,0 +1075,0 @@ if (leading && main) {

2

package.json
{
"name": "react-swipeable-list",
"description": "Swipeable list component for React",
"version": "1.6.0",
"version": "1.7.0",
"author": {

@@ -6,0 +6,0 @@ "name": "Marek Rozmus",

@@ -89,2 +89,10 @@ <h1 align="center">react-swipeable-list</h1>

### actionDelay
Type: `milliseconds` (optional, default: `0`)
Time in milliseconds after which swipe action and animation should be called after trigggering swipe action.
It can be set for the whole list or for every item. See `actionDelay` for `SwipeableListItem`. Value from the `SwipeableListItem` takes precedence.
### fullSwipe

@@ -167,2 +175,10 @@

### actionDelay
Type: `milliseconds` (optional, default: `0`)
Time in milliseconds after which swipe action and animation should be called after trigggering swipe action.
It can be set for the whole list or for every item. See `actionDelay` for `SwipeableList`. Value from the `SwipeableListItem` takes precedence.
### blockSwipe

@@ -169,0 +185,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc