{"_id":"@manjiz/react-native-swiper","_rev":"356291","name":"@manjiz/react-native-swiper","description":"Not the best Swiper component for React Native.","dist-tags":{"latest":"0.1.3"},"maintainers":[{"name":"manjiz","email":"25199230@qq.com"}],"time":{"modified":"2021-07-13T08:22:18.000Z","created":"2019-06-26T07:02:14.558Z","0.1.3":"2019-07-25T08:12:53.447Z","0.0.3":"2019-06-26T07:29:59.755Z","0.0.2":"2019-06-26T07:09:47.418Z","0.0.1":"2019-06-26T07:02:14.558Z"},"users":{},"author":{"name":"Manjiz"},"repository":{"type":"git","url":"git+https://github.com/Manjiz/react-native-swiper.git"},"versions":{"0.1.3":{"name":"@manjiz/react-native-swiper","version":"0.1.3","description":"Not the best Swiper component for React Native.","main":"./dist/index.js","scripts":{"build":"tsc --declaration"},"repository":{"type":"git","url":"git+https://github.com/Manjiz/react-native-swiper.git"},"keywords":["swiper","react-native"],"author":{"name":"Manjiz"},"license":"MIT","peerDependencies":{"react":"^16.3.1","react-native":"^0.55.4"},"devDependencies":{"@types/react":"^16.3.1","@types/react-native":"^0.55.4","typescript":"^3.5.2"},"gitHead":"d90b160001e827f8d5b269298fd51c15955125c4","bugs":{"url":"https://github.com/Manjiz/react-native-swiper/issues"},"homepage":"https://github.com/Manjiz/react-native-swiper#readme","_id":"@manjiz/react-native-swiper@0.1.3","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"shasum":"979c2bb3469b43b34aeb0ef628a7c4022690fc0e","size":19879,"noattachment":false,"key":"/@manjiz/react-native-swiper/-/@manjiz/react-native-swiper-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@manjiz/react-native-swiper/download/@manjiz/react-native-swiper-0.1.3.tgz"},"maintainers":[{"name":"manjiz","email":"25199230@qq.com"}],"_npmUser":{"name":"manjiz","email":"535985853@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-swiper_0.1.3_1564042373322_0.3432145193357663"},"_hasShrinkwrap":false,"publish_time":1564042373447,"_cnpm_publish_time":1564042373447},"0.0.3":{"name":"@manjiz/react-native-swiper","version":"0.0.3","description":"Not the best Swiper component for React Native.","main":"./dist/index.js","scripts":{"build":"tsc --declaration"},"repository":{"type":"git","url":"git+https://github.com/Manjiz/react-native-swiper.git"},"keywords":["swiper","react-native"],"author":{"name":"Manjiz"},"license":"MIT","peerDependencies":{"react":"^16.3.1","react-native":"^0.55.4"},"devDependencies":{"@types/react":"^16.3.1","@types/react-native":"^0.55.4","typescript":"^3.5.2"},"bugs":{"url":"https://github.com/Manjiz/react-native-swiper/issues"},"homepage":"https://github.com/Manjiz/react-native-swiper#readme","_id":"@manjiz/react-native-swiper@0.0.3","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"shasum":"bcc03e573121751d50579050ef38461e21f33233","size":11147,"noattachment":false,"key":"/@manjiz/react-native-swiper/-/@manjiz/react-native-swiper-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@manjiz/react-native-swiper/download/@manjiz/react-native-swiper-0.0.3.tgz"},"maintainers":[{"name":"manjiz","email":"25199230@qq.com"}],"_npmUser":{"name":"manjiz","email":"535985853@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-swiper_0.0.3_1561534199641_0.10500303858831517"},"_hasShrinkwrap":false,"publish_time":1561534199755,"_cnpm_publish_time":1561534199755},"0.0.2":{"name":"@manjiz/react-native-swiper","version":"0.0.2","description":"Not the best Swiper component for React Native.","main":"./dist/index.js","scripts":{"build":"tsc"},"repository":{"type":"git","url":"git+https://github.com/Manjiz/react-native-swiper.git"},"keywords":["swiper","react-native"],"author":{"name":"Manjiz"},"license":"MIT","peerDependencies":{"react":"^16.3.1","react-native":"^0.55.4"},"devDependencies":{"@types/react":"^16.3.1","@types/react-native":"^0.55.4","typescript":"^3.5.2"},"bugs":{"url":"https://github.com/Manjiz/react-native-swiper/issues"},"homepage":"https://github.com/Manjiz/react-native-swiper#readme","_id":"@manjiz/react-native-swiper@0.0.2","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"shasum":"f3ebc3c6d090a9f9cea35c53f2ee49c1a8ce1a34","size":10095,"noattachment":false,"key":"/@manjiz/react-native-swiper/-/@manjiz/react-native-swiper-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@manjiz/react-native-swiper/download/@manjiz/react-native-swiper-0.0.2.tgz"},"maintainers":[{"name":"manjiz","email":"25199230@qq.com"}],"_npmUser":{"name":"manjiz","email":"535985853@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-swiper_0.0.2_1561532987211_0.26411188980416545"},"_hasShrinkwrap":false,"publish_time":1561532987418,"_cnpm_publish_time":1561532987418},"0.0.1":{"name":"@manjiz/react-native-swiper","version":"0.0.1","description":"Not the best Swiper component for React Native.","main":"./dist/index.js","scripts":{"build":"tsc"},"repository":{"type":"git","url":"git+https://github.com/Manjiz/react-native-swiper.git"},"keywords":["swiper","react-native"],"author":{"name":"Manjiz"},"license":"MIT","peerDependencies":{"react":"^16.3.1","react-native":"^0.55.4"},"devDependencies":{"@types/react":"^16.3.1","@types/react-native":"^0.55.4","typescript":"^3.5.2"},"bugs":{"url":"https://github.com/Manjiz/react-native-swiper/issues"},"homepage":"https://github.com/Manjiz/react-native-swiper#readme","_id":"@manjiz/react-native-swiper@0.0.1","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"shasum":"a4eac60154ac37542ee102a29e6963c675daca29","size":7438,"noattachment":false,"key":"/@manjiz/react-native-swiper/-/@manjiz/react-native-swiper-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@manjiz/react-native-swiper/download/@manjiz/react-native-swiper-0.0.1.tgz"},"maintainers":[{"name":"manjiz","email":"25199230@qq.com"}],"_npmUser":{"name":"manjiz","email":"535985853@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-swiper_0.0.1_1561532534464_0.29564072192127"},"_hasShrinkwrap":false,"publish_time":1561532534558,"_cnpm_publish_time":1561532534558}},"readme":"<h1 align=\"center\">\n  <a href=\"https://github.com/manjiz/react-native-swiper\">\n    @manjiz/react-native-swiper\n  </a>\n</h1>\n\n<p align=\"center\">\n  <a href=\"https://github.com/Manjiz/react-native-swiper/blob/master/LICENSE\">\n    <img src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"React Native Swiper is released under the MIT license.\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/@manjiz/react-native-swiper\">\n    <img src=\"https://badge.fury.io/js/%40manjiz%2Freact-native-swiper.svg\" alt=\"Current npm package version.\" />\n  </a>\n</p>\n\nThis swiper is modified based on [leecade/react-native-swiper](https://github.com/leecade/react-native-swiper). Not the best Swiper component for React Native.\n\n- Fixed some remained bugs.\n- Both iOS and android use ScrollView.\n- Removed some inessentials.\n- Used typescript.\n- Be Tested in one online project (lack of test...need more...)\n- Dependencies Versions:\n  - react-native@^0.55.4\n  - react@^16.3.1\n\n## Example\n\n- [Taro Components RN](https://github.com/NervJS/taro/blob/master/packages/taro-components-rn/src/components/Swiper/index.tsx)\n  - 京東拼購 [iOS](https://apps.apple.com/us/app/%E4%BA%AC%E4%B8%9C%E6%8B%BC%E8%B4%AD-%E7%9C%81%E9%92%B1%E7%9C%81%E5%BF%83/id1453661340?from=groupmessage&isappinstalled=0) and android. The Swiper is locate in the index.\n\n## Installation\n\n```bash\nnpm i @manjiz/react-native-swiper --save\n```\n\n## Basic Usage\n\n```jsx\nimport React, { Component } from 'react'\nimport {\n  View,\n  Text\n} from 'react-native'\nimport Swiper from '@manjiz/react-native-swiper'\n\nclass Example extends Component {\n  onIndexChanged = (index: number) => {\n  }\n\n  onMomentumScrollEnd = (e, state) => {\n  }\n\n  render () {\n    const slideStyle = { flex: 1, justifyContent: 'center', alignItems: 'center' }\n\n    return (\n      <Swiper\n        autoplay={true}\n        autoplayTimeout={6}\n      >\n        <View style={[slideStyle, { backgroundColor: 'red' }]}>\n          <Text>Red</Text>\n        </View>\n        <View style={[slideStyle, { backgroundColor: 'green' }]}>\n          <Text>Green</Text>\n        </View>\n        <View style={[slideStyle, { backgroundColor: 'blue' }]}>\n          <Text>Blue</Text>\n        </View>\n      </Swiper>\n    )\n  }\n}\n\nexport default Example\n```\n\n## Properties\n\n### Basic\n\n| Prop              | Type    | Default | Description |\n| ----------------- | ------- | ------- | ----------- |\n| horizontal        | boolean | true    | If true, the scroll view's children are arranged horizontally in a row instead of vertically in a column |\n| loop              | boolean | true    | Set to false to disable continuous loop mode |\n| autoplay          | boolean | false   | Set to true enable auto play mode |\n| index             | number  | 0       | Index number of initial slide. And real index would be sync as it changed |\n| loadMinimal       | boolean | false   | Only load current index slide , loadMinimalSize slides before and after |\n| loadMinimalSize   | number  | 1       | see loadMinimal |\n| showsPagination   | boolean | true    | Set to false make pagination invisible. |\n| autoplayTimeout   | number  | 2.5     | Delay between auto play transitions (in second) |\n| autoplayDirection | boolean | true    | Cycle direction control |\n\n\n### Element\n\n| Prop              | Type    | Default | Description |\n| ----------------- | ------- | ------- | ----------- |\n| loadMinimalLoader | Element | <ActivityIndicator /> | Custom loader to display when slides aren't loaded |\n| dot               | Element | <View ... /> | Allow custom the dot element |\n| activeDot         | Element | <View ... /> | Allow custom the active-dot element |\n| renderPagination  | (index: number, total: number, swiper: any) => JSX.Element | see source code |\n\n### Styleus\n\n| Prop              | Type      | Default | Description |\n| ----------------- | --------- | ------- | ----------- |\n| width             | number    | -       | If no specify default enable fullscreen mode by flex: 1 |\n| height            | number    | -       | If no specify default fullscreen mode by flex: 1 |\n| dotColor          | string    | -       | Allow custom the dot element |\n| activeDotColor    | string    | -       | Allow custom the active-dot element |\n| containerStyle    | ViewStyle | -       | See default container style in source |\n| scrollViewStyle   | ViewStyle | -       | Style set to ScrollView |\n| style             | ViewStyle | -       | Style set to ScrollView contentContainerStyle |\n| paginationStyle   | ViewStyle | -       | pagination wrapper style |\n| dotStyle          | ViewStyle | -       | Allow custom the dot element |\n| activeDotStyle    | ViewStyle | -       | Allow custom the active-dot element |\n\n### Native ScrollView Props\n\nNo need to change them.\n\n### Event\n\n| Prop           | Type | Description | \n| -------------- | ---- | ----------- |\n| onIndexChanged | index | Called with the new index when the user swiped |\n\n**Supported ScrollResponder**\n\n| Prop           | Type | Description | \n| -------------- | ---- | ----------- |\n| onScrollBeginDrag | e / state / context | When animation begins after letting up |\n| onMomentumScrollEnd | e / state / context | Makes no sense why this occurs first during bounce |\n| onTouchStartCapture | e / state / context | Immediately after onMomentumScrollEnd |\n| onTouchStart | e / state / context | Same, but bubble phase |\n| onTouchEnd | e / state / context | You could hold the touch start for a long time |\n| onResponderRelease | e / state / context | You could hold the touch start for a long time |\n\n> Note: each ScrollResponder be injected with two params: state and context, you can get state and context(ref to swiper's this) from params.\n\n## Methods\n\n### scrollBy\n\nScroll by relative index.\n\nParameters:\n\n| Name | Type | default | Description |\n| ---- | ---- | ------- | ----------- |\n| index | number | undefined | offset index |\n| animated | bool | true | offset index |\n\n## Contribution\n\n### Local Development\n\n```bash\nrsync -avr ~/react-native-swiper/dist ~/MyApp/node_modules/@manjiz/react-native-swiper\n```\n","_attachments":{},"homepage":"https://github.com/Manjiz/react-native-swiper#readme","bugs":{"url":"https://github.com/Manjiz/react-native-swiper/issues"},"license":"MIT"}