npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cross2d/react-web-swipe-left

v1.0.0

Published

RN swipe-left component for listView.(左滑解决方案)

Downloads

5

Readme

react-native-swipe-left

a RN swipe-left component for listView.(左滑解决方案)

IOS && ANDROID

IOS | Android -----|------- swipeleft ios preview | swipeleft android preview

IOS | Android -----|------- swipeleft ios preview | swipeleft android preview

Features (特性)

RESOLVE | 解决 ----------------- | ----- | ---------- the Opposite effect between two rows |(row之间的互斥收回) button configurable(one or more, text/image, bgcolor, width,callback etc)|左边按钮的可配置化(可配置多按钮,文字/图片,背景色,宽度,回调) pressable in single row |单个row内的按钮或链接可点击 optional animation type, timing/spring |可选择滚动动画类型,timing/spring

Installation

npm install --save react-native-swipe-left

Usage example

see the example/example.js for a more detailed example.

// 1, settings in your constructor
constructor(props) {
 	this._dataRow = {};
    this.openRowId = '';
    this.state = {
	    scrollEnable: true,
        hasIdOpen: false
    };
}

// 2, set scrollEnabled  
<ScrollView scrollEnabled={this.state.scrollEnable} {...props}/>

// 3, set your button`s setting
let rightBtn = [{
    id: 1,
	text: 'button',
	width: 80,
	bgColor: 'red',
	underlayColor: '#ffffff',
    onPress: ()=>{alert('delete1!');},
}, {
      id: 2,
      image: 'your uri',
      width: 80,
      bgColor: null,
      onPress: ()=>{alert('delete2!')}
}, {
	id: 3,
	text: 'button',
	width: 80,
	bgColor: 'yellow',
	onPress: ()=>{alert('delete3!');},
}]


// 4, in your renderRow function(a is sectionId, b is rowId)
let id = '' + a + b; 
<SwipeitemView 
    root={this}
    ref={(row)=>this._dataRow[id] = row}
    id={id}
    data={data}
    rightBtn={rightBtn}>
	{children node}
</SwipeitemView>

Props

component:

Prop | Type | Optional | Default | Description --------------- | ------ | --------- | ---------- | ----------- root | current component | require | | current component ref | function | require | | it is row`s identity card id | string | require | | identity card rightBtn | array | require | | your buttons, one or more

row:

Prop | Type | Optional | Default | Description --------------- | ------ | --------- | ---------- | ----------- boxbgColor | string | Yes | '#eeeeee' | when you swipe the row a lot ,youll see this color rowbgColor | string | Yes | '#ffffff' | rows bgColor animationType | string | Yes | 'timing' | animation type duration | number | Yes | 150 | The animation process time

button:

Prop | Type | Optional | Default | Description --------------- | ------ | --------- | ---------- | ----------- id | number | require | | deal with the 'key' problem text/image | string | Yes | | use text or a image width | number | Yes | | the width of button bgColor | string | Yes | | backgroundColor of button onPress | function| Yes | | the callback when you press a button underlayColor | string | Yes | | the underlayColor of TouchableHighlight

Note:

从组件本身来讲,已经完成了ios/android端能够流畅左滑的工作(优化过程),但还可以继续优化体验,除了上面特性的可配置化,后期会增加更多灵活的配置,如:是否选择互斥,或是类似qq那样单次滑动只做一件事,滑出或滑进。