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

react-native-complete-flatlist

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-complete-flatlist - npm Package Compare versions

Comparing version 1.1.32 to 1.1.33

61

index.js

@@ -11,3 +11,2 @@ import React, { Component } from "react";

} from "react-native";
import PropTypes from "prop-types";

@@ -21,4 +20,23 @@ class CompleteFlatList extends Component {

constructor(props) {
super(props)
static defaultProps = {
searchKey: [],
placeholder: "Search ...",
data: [],
isRefreshing: false,
renderItem: null,
renderSeparator: () => <View style={styles.defaultSeparator} />,
pullToRefreshCallback: null,
onSearch: null,
highlightColor: "",
backgroundStyles: {},
searchTextInputStyle: {},
searchBarBackgroundStyles: {},
renderEmptyRow: () => (
<Text style={styles.noData}>{"No data available"}</Text>
),
elementBetweenSearchAndList: null
};
constructor(props, defaultProps) {
super(props, defaultProps)
const { refreshOnLoad = true, pullToRefreshCallback } = props

@@ -30,2 +48,4 @@ if (pullToRefreshCallback !== null && refreshOnLoad) {

clearSearch = () => this.searchInput.clear()
onRefresh = () => {

@@ -111,2 +131,3 @@ this.props.pullToRefreshCallback();

<TextInput
ref={c => this.searchInput = c}
style={[styles.searchBar, searchTextInputStyle]}

@@ -169,36 +190,2 @@ placeholder={placeholder}

CompleteFlatList.propTypes = {
searchKey: PropTypes.array,
data: PropTypes.array,
renderItem: PropTypes.func,
renderSeparator: PropTypes.func,
pullToRefreshCallback: PropTypes.func,
onSearch: PropTypes.func,
highlightColor: PropTypes.string,
isRefreshing: PropTypes.bool,
backgroundStyles: PropTypes.object,
searchBarBackgroundStyles: PropTypes.object,
renderEmptyRow: PropTypes.func,
placeholder: PropTypes.string,
searchTextInputStyle: PropTypes.object,
elementBetweenSearchAndList: PropTypes.element
};
CompleteFlatList.defaultProps = {
searchKey: [],
placeholder: "Search ...",
data: [],
isRefreshing: false,
renderItem: null,
renderSeparator: () => <View style={styles.defaultSeparator} />,
pullToRefreshCallback: null,
onSearch: null,
highlightColor: "",
backgroundStyles: {},
searchTextInputStyle: {},
searchBarBackgroundStyles: {},
renderEmptyRow: () => (
<Text style={styles.noData}>{"No data available"}</Text>
),
elementBetweenSearchAndList: null
};

@@ -205,0 +192,0 @@ const styles = StyleSheet.create({

{
"name": "react-native-complete-flatlist",
"version": "1.1.32",
"version": "1.1.33",
"description": "An extension of ReactNative's flatlist with search bar, highlighted search, pull to refresh, and etc is ready to use",

@@ -38,5 +38,4 @@ "main": "index.js",

"dependencies": {
"prop-types": "^15.5.10",
"react-native-highlight-words": "git+https://github.com/fattahmuhyiddeen/react-native-highlight-words.git#master"
}
}

@@ -75,2 +75,3 @@ # react-native-complete-flatlist

data={data}
ref={c => this.completeFlatList = c}
renderSeparator={null}

@@ -110,2 +111,21 @@ renderItem={this.cell}

|`refreshOnLoad`|boolean|If `true`, prop `pullToRefreshCallback` will be called if available|true|Optional|
|`onSearch`|function that will replace `pullToRefreshCallback`|If exist, `pullToRefreshCallback` will be overrided. This will not triggered on key press, but on return key pressed. This props is introduced if search trigger result from API. If you just want local search (search from existing array), this props is not needed. `onSearch` will automatic get `keyword` parameter|()=>null|Optional|
|`onSearch`|function that will replace `pullToRefreshCallback`|If exist, `pullToRefreshCallback` will be overrided. This will not triggered on key press, but on return key pressed. This props is introduced if search trigger result from API. If you just want local search (search from existing array), this props is not needed. `onSearch` will automatic get `keyword` parameter|()=>null|Optional|
### Methods
If you have ```ref``` to the component,
```
<CompleteFlatList
...
ref={c => this.completeFlatList = c}
...
/>
```
you can use any method(s) below
```this.completeFlatList.methodName()```
|Method|Description|
|------|-----------|
|clearSearch|Clear search input programmatically|
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