react-native-picker-actionsheet
Advanced tools
Comparing version 1.1.4 to 1.2.0
102
package.json
{ | ||
"name": "react-native-picker-actionsheet", | ||
"version": "1.1.4", | ||
"description": "A picker like ActionSheet component which can be used in iOS & Android . Use Animated . ", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"_args": [ | ||
[ | ||
{ | ||
"raw": "react-native-picker-actionsheet", | ||
"scope": null, | ||
"escapedName": "react-native-picker-actionsheet", | ||
"name": "react-native-picker-actionsheet", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"/Users/liulirui/Desktop/test/mojom" | ||
] | ||
], | ||
"_cnpm_publish_time": 1519664210164, | ||
"_from": "react-native-picker-actionsheet", | ||
"_hasShrinkwrap": false, | ||
"_id": "react-native-picker-actionsheet@1.1.4", | ||
"_location": "/react-native-picker-actionsheet", | ||
"_nodeVersion": "8.9.4", | ||
"_npmOperationalInternal": { | ||
"host": "s3://npm-registry-packages", | ||
"tmp": "tmp/react-native-picker-actionsheet_1.1.4_1519664210118_0.0960600424818785" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/BooYeu/react-native-picker-actionsheet.git" | ||
"_npmUser": { | ||
"name": "booyeu", | ||
"email": "admin@booyeu.com" | ||
}, | ||
"keywords": [ | ||
"react-native", | ||
"react-native-picker-actionsheet" | ||
"_npmVersion": "4.6.1", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"raw": "react-native-picker-actionsheet", | ||
"scope": null, | ||
"escapedName": "react-native-picker-actionsheet", | ||
"name": "react-native-picker-actionsheet", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"_requiredBy": [ | ||
"#USER", | ||
"/" | ||
], | ||
"author": "BooYeu - llr", | ||
"license": "ISC", | ||
"_resolved": "http://registry.npm.taobao.org/react-native-picker-actionsheet/download/react-native-picker-actionsheet-1.1.4.tgz", | ||
"_shasum": "d34bf8d87ac27052d9f85c418f66c071f863c1d9", | ||
"_shrinkwrap": null, | ||
"_spec": "react-native-picker-actionsheet", | ||
"_where": "/Users/liulirui/Desktop/test/mojom", | ||
"author": { | ||
"name": "BooYeu - llr" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/BooYeu/react-native-picker-actionsheet/issues" | ||
}, | ||
"homepage": "https://github.com/BooYeu/react-native-picker-actionsheet#readme", | ||
"devDependencies": { | ||
"dependencies": {}, | ||
"description": "A picker like ActionSheet component which can be used in iOS & Android . Use Animated . ", | ||
"devDependencies": { | ||
"pre-commit": "^1.1.3", | ||
@@ -29,3 +64,36 @@ "react": "^16.0.0-beta.5", | ||
"react-test-renderer": "^16.0.0-beta.5" | ||
} | ||
}, | ||
"directories": {}, | ||
"dist": { | ||
"shasum": "d34bf8d87ac27052d9f85c418f66c071f863c1d9", | ||
"size": 2869, | ||
"noattachment": false, | ||
"tarball": "http://registry.npm.taobao.org/react-native-picker-actionsheet/download/react-native-picker-actionsheet-1.1.4.tgz" | ||
}, | ||
"homepage": "https://github.com/BooYeu/react-native-picker-actionsheet#readme", | ||
"keywords": [ | ||
"react-native", | ||
"react-native-picker-actionsheet" | ||
], | ||
"license": "ISC", | ||
"main": "src/index.js", | ||
"maintainers": [ | ||
{ | ||
"name": "booyeu", | ||
"email": "admin@booyeu.com" | ||
} | ||
], | ||
"name": "react-native-picker-actionsheet", | ||
"optionalDependencies": {}, | ||
"publish_time": 1519664210164, | ||
"readme": "# react-native-picker-actionsheet [![Monthly download](https://img.shields.io/npm/dm/react-native-picker-actionsheet.svg)](https://img.shields.io/npm/dm/react-native-picker-actionsheet.svg) [![Total downloads](https://img.shields.io/npm/dt/react-native-picker-actionsheet.svg)](https://img.shields.io/npm/dt/react-native-picker-actionsheet.svg)\n\n## Install\n\n```bash\nnpm install react-native-picker-actionsheet --save\n```\n\n## Usage\n\n```javascript\nimport PickerActionSheet from 'react-native-picker-actionsheet';\n\n<PickerActionSheet />\n```\n\n## Example\n\n![ios](https://raw.githubusercontent.com/BooYeu/react-native-picker-actionsheet/master/images/ios.jpg)\n![android](https://raw.githubusercontent.com/BooYeu/react-native-picker-actionsheet/master/images/android.jpg)\n\n## Properties\n\n| Prop | Default | Required | Description |\n| :------------ |:---------------:| :---------------:| :-----|\n| show | false | yes | Controller whether or not show it |\n| height | 120 | yes | The height of the container,you have to change it for your requirement |\n| title | '' | no | The title text of the container |\n| titleRight | null | no | The compoment on the right hand of title |\n| data | [] | no | The data you give users to picker |\n| renderItem | ({item,index})=>{} | no | Function that shows data | \n| onCancel | ()=>{} | no | Function that is called when user cancels it |\n| onSubmit | (text)=>{} | no | Function that is called when user submits it |\n| cancelText | 'cancel' | no | The string that is displayed on the cancel button |\n| submitText | 'submit' | no | The string that is displayed on the submit button |\n", | ||
"readmeFilename": "README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/BooYeu/react-native-picker-actionsheet.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"version": "1.2.0" | ||
} |
@@ -36,1 +36,2 @@ # react-native-picker-actionsheet [![Monthly download](https://img.shields.io/npm/dm/react-native-picker-actionsheet.svg)](https://img.shields.io/npm/dm/react-native-picker-actionsheet.svg) [![Total downloads](https://img.shields.io/npm/dt/react-native-picker-actionsheet.svg)](https://img.shields.io/npm/dt/react-native-picker-actionsheet.svg) | ||
| submitText | 'submit' | no | The string that is displayed on the submit button | | ||
| shadowClick | 'submit' | no | The string that is 'cancel' or 'submit' when shadow is clicked | |
import React from 'react'; | ||
import {StyleSheet,Animated,View,Text,TouchableWithoutFeedback} from 'react-native'; | ||
import {StyleSheet,Animated,Modal,View,ScrollView,Text,TouchableWithoutFeedback,Dimensions} from 'react-native'; | ||
@@ -14,4 +14,5 @@ export default class extends React.Component{ | ||
submitText:'submit', | ||
onSubmit:()=>{}, | ||
onCancel:()=>{}, | ||
onSubmit:()=>{} | ||
shadowClick:'submit' | ||
}; | ||
@@ -44,4 +45,4 @@ constructor(props){ | ||
return( | ||
<View style={[styles.container,{zIndex:this.state.show||this.props.show?100:-100}]}> | ||
<TouchableWithoutFeedback onPress={()=>this.props.onSubmit()}> | ||
this.state.show||this.props.show?<Modal transparent={true} onRequestClose={()=>this.props.onCancel()}> | ||
<TouchableWithoutFeedback onPress={()=>this.props.shadowClick==='submit'?this.props.onSubmit():this.props.onCancel()}> | ||
<Animated.View style={[styles.masker,{opacity:this.state.maskerOpacity}]} /> | ||
@@ -66,7 +67,11 @@ </TouchableWithoutFeedback> | ||
</View> | ||
<View style={styles.items}> | ||
{item} | ||
</View> | ||
{item.length>0?this.props.scrollEnabled? | ||
<ScrollView style={styles.items_scroll}> | ||
{item} | ||
</ScrollView>: | ||
<View style={styles.items}> | ||
{item} | ||
</View>:this.props.ListEmptyComponent} | ||
</Animated.View> | ||
</View> | ||
</Modal>:null | ||
); | ||
@@ -77,11 +82,2 @@ } | ||
const styles=StyleSheet.create({ | ||
container:{ | ||
flex:1, | ||
position:'absolute', | ||
top:0, | ||
bottom:0, | ||
left:0, | ||
right:0, | ||
zIndex:100 | ||
}, | ||
masker:{ | ||
@@ -123,7 +119,11 @@ backgroundColor:'#000', | ||
flexDirection:'row', | ||
justifyContent:'center', | ||
justifyContent:'space-around', | ||
alignItems:'center', | ||
flexWrap:'wrap', | ||
backgroundColor:'#f9f9f9' | ||
} | ||
}, | ||
items_scroll:{ | ||
paddingVertical:6, | ||
backgroundColor:'#f9f9f9' | ||
} | ||
}); |
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
11007
37