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

react-native-drag-sort

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-drag-sort - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

83

DragSortableView.js

@@ -5,5 +5,4 @@ import React, {Component} from 'react'

const PropTypes = require('prop-types')
const {width,height} = Dimensions.get('window')
const {width} = Dimensions.get('window')
const measureDelay = 100
const defaultZIndex = 8

@@ -342,39 +341,3 @@ const touchZIndex = 99

>
{
this.state.dataSource.map((item,index)=>{
const transformObj = {}
transformObj[this.props.scaleStatus] = item.scaleValue
return (
<Animated.View
key={item.originIndex}
ref={(ref) => this.sortRefs.set(index,ref)}
{...this._panResponder.panHandlers}
style={[styles.item,{
marginTop: this.props.marginChildrenTop,
marginBottom: this.props.marginChildrenBottom,
marginLeft: this.props.marginChildrenLeft,
marginRight: this.props.marginChildrenRight,
left: item.position.x,
top: item.position.y,
opacity: item.scaleValue.interpolate({
inputRange:[1,maxScale],
outputRange:[1,minOpacity]
}),
transform: [transformObj]
}]}>
<TouchableOpacity
activeOpacity = {1}
onPressOut={()=> this.onPressOut()}
onLongPress={()=>this.startTouch(index)}
onPress={()=>{
if (this.props.onClickItem) {
this.props.onClickItem(this.getOriginalData(),item.data,index)
}
}}>
{this.props.renderItem(item.data,index)}
</TouchableOpacity>
</Animated.View>
)
})
}
{this._renderItemView()}
</View>

@@ -384,2 +347,41 @@ )

_renderItemView = () => {
return this.state.dataSource.map((item,index)=>{
const transformObj = {}
transformObj[this.props.scaleStatus] = item.scaleValue
const key = this.props.keyExtractor ? this.props.keyExtractor(item.data,index) : item.originIndex
return (
<Animated.View
key={key}
ref={(ref) => this.sortRefs.set(index,ref)}
{...this._panResponder.panHandlers}
style={[styles.item,{
marginTop: this.props.marginChildrenTop,
marginBottom: this.props.marginChildrenBottom,
marginLeft: this.props.marginChildrenLeft,
marginRight: this.props.marginChildrenRight,
left: item.position.x,
top: item.position.y,
opacity: item.scaleValue.interpolate({
inputRange:[1,maxScale],
outputRange:[1,minOpacity]
}),
transform: [transformObj]
}]}>
<TouchableOpacity
activeOpacity = {1}
onPressOut={()=> this.onPressOut()}
onLongPress={()=>this.startTouch(index)}
onPress={()=>{
if (this.props.onClickItem) {
this.props.onClickItem(this.getOriginalData(),item.data,index)
}
}}>
{this.props.renderItem(item.data,index)}
</TouchableOpacity>
</Animated.View>
)
})
}
componentWillUnmount() {

@@ -410,3 +412,4 @@ if (this.isScaleRecovery) clearTimeout(this.isScaleRecovery)

scaleStatus: PropTypes.oneOf('scale','scaleX','scaleY'),
fixedItems: PropTypes.array
fixedItems: PropTypes.array,
keyExtractor: PropTypes.func
}

@@ -413,0 +416,0 @@

{
"name": "react-native-drag-sort",
"version": "1.2.0",
"version": "1.3.0",
"description": "Drag and drop sort control for react-native",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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