mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 17:43:00 +08:00
[remove] Swipeable
This commit is contained in:
10
README.md
10
README.md
@@ -142,10 +142,6 @@ and child content.
|
||||
|
||||
(TODO)
|
||||
|
||||
### [`Swipeable`](docs/components/Swipeable.md)
|
||||
|
||||
Touch bindings for swipe gestures.
|
||||
|
||||
### [`Text`](docs/components/Text.md)
|
||||
|
||||
Displays text as an inline block and supports basic press handling.
|
||||
@@ -183,10 +179,8 @@ welcome!
|
||||
Thanks to current and past members of the React and React Native teams (in
|
||||
particular Vjeux and Pete Hunt), and Tobias Koppers for Webpack and CSS loader.
|
||||
|
||||
Thanks to [react-swipeable](https://github.com/dogfessional/react-swipeable/)
|
||||
for the current implementation of `Swipeable`, and to
|
||||
[react-tappable](https://github.com/JedWatson/react-tappable) for backing the
|
||||
current implementation of `Touchable`.
|
||||
Thanks to [react-tappable](https://github.com/JedWatson/react-tappable) for
|
||||
backing the current implementation of `Touchable`.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
# Swipeable
|
||||
|
||||
Unique to web.
|
||||
|
||||
## Props
|
||||
|
||||
**delta**: number = 10
|
||||
|
||||
Number of pixels that must be swiped before events are dispatched.
|
||||
|
||||
**flickThreshold**: number = 0.6
|
||||
|
||||
The velocity threshold at which a swipe is considered a flick.
|
||||
|
||||
**onSwiped**: function
|
||||
|
||||
(SyntheticTouchEvent, deltaX, deltaY, isFlick) => swipeHandler
|
||||
|
||||
Called once a swipe has ended.
|
||||
|
||||
**onSwipedDown**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called once a swipe-down has ended.
|
||||
|
||||
**onSwipedLeft**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called once a swipe-left has ended.
|
||||
|
||||
**onSwipedUp**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called once a swipe-up has ended.
|
||||
|
||||
**onSwipedRight**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called once a swipe-right has ended.
|
||||
|
||||
**onSwipingDown**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called while a swipe-down is in progress.
|
||||
|
||||
**onSwipingLeft**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called while a swipe-left is in progress.
|
||||
|
||||
**onSwipingRight**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called while a swipe-right is in progress.
|
||||
|
||||
**onSwipingUp**: function
|
||||
|
||||
(SyntheticTouchEvent, delta, isFlick) => swipeHandler
|
||||
|
||||
Called while a swipe-up is in progress.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
import React, { Swipeable } from 'react-native-web'
|
||||
|
||||
const { Component, PropTypes } = React;
|
||||
|
||||
class Example extends Component {
|
||||
static propTypes = {
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
}
|
||||
|
||||
_onSwiped(event, x, y, isFlick) {
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Swipeable
|
||||
onSwiped={this._onSwiped.bind(this)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -18,7 +18,6 @@
|
||||
"dependencies": {
|
||||
"inline-style-prefixer": "^0.3.3",
|
||||
"react": ">=0.13.3",
|
||||
"react-swipeable": "^3.0.2",
|
||||
"react-tappable": "^0.6.0",
|
||||
"react-textarea-autosize": "^2.5.3"
|
||||
},
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
import Swipeable from 'react-swipeable'
|
||||
export default Swipeable
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { Image, StyleSheet, Swipeable, Text, TextInput, Touchable, View } from '.'
|
||||
import React, { Image, StyleSheet, Text, TextInput, Touchable, View } from '.'
|
||||
|
||||
const { Component, PropTypes } = React
|
||||
|
||||
@@ -58,7 +58,7 @@ class Example extends Component {
|
||||
<Text>React Native Web takes the core components from <Text
|
||||
component='a' href='https://facebook.github.io/react-native/'>React
|
||||
Native</Text> and brings them to the web. These components provide
|
||||
simple building blocks – touch and swipe handling, flexbox layout,
|
||||
simple building blocks – touch handling, flexbox layout,
|
||||
scroll views – from which more complex components and apps can be
|
||||
constructed.</Text>
|
||||
|
||||
@@ -85,21 +85,6 @@ class Example extends Component {
|
||||
testID='Example.image'
|
||||
/>
|
||||
|
||||
<Heading level='2' size='large'>Swipeable</Heading>
|
||||
<Swipeable
|
||||
onSwiped={(e) => { console.log('Swipeable.onSwiped', e) }}
|
||||
testID={'Example.swipeable'}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: 'black',
|
||||
alignSelf: 'center',
|
||||
width: '200px',
|
||||
height: '200px'
|
||||
}}
|
||||
/>
|
||||
</Swipeable>
|
||||
|
||||
<Heading level='2' size='large'>Text</Heading>
|
||||
<Text
|
||||
onPress={(e) => { console.log('Text.onPress', e) }}
|
||||
|
||||
@@ -6,7 +6,6 @@ import StyleSheet from './modules/StyleSheet'
|
||||
import Image from './components/Image'
|
||||
import ListView from './components/ListView'
|
||||
import ScrollView from './components/ScrollView'
|
||||
import Swipeable from './components/Swipeable'
|
||||
import Text from './components/Text'
|
||||
import TextInput from './components/TextInput'
|
||||
import Touchable from './components/Touchable'
|
||||
@@ -21,7 +20,6 @@ export {
|
||||
Image,
|
||||
ListView,
|
||||
ScrollView,
|
||||
Swipeable,
|
||||
Text,
|
||||
TextInput,
|
||||
Touchable,
|
||||
|
||||
Reference in New Issue
Block a user