Skip to content

Commit 51ad9bc

Browse files
authored
v3.1.0
1 parent bc14dd1 commit 51ad9bc

77 files changed

Lines changed: 11293 additions & 646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# EditorConfig is awesome: http://EditorConfig.org
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file
8+
[*]
9+
end_of_line = lf
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 2

.eslintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"plugins": ["react", "react-native", "jsx-a11y", "import"],
5+
"rules": {
6+
"semi": "off",
7+
"no-underscore-dangle": "off",
8+
"no-plusplus": "off",
9+
"react/jsx-filename-extension": "off",
10+
"no-unused-expressions": "off",
11+
"no-alert": "off",
12+
"no-debugger": "off"
13+
},
14+
"env": {
15+
"browser": true
16+
}
17+
}
File renamed without changes.

.gitignore

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
# npm
2+
#
3+
node_modules
4+
npm-debug.log
5+
6+
# OSX
7+
#
8+
.DS_Store
9+
10+
# Xcode
11+
#
12+
*.xcscmblueprint
13+
build/
14+
*.pbxuser
15+
!default.pbxuser
16+
*.mode1v3
17+
!default.mode1v3
18+
*.mode2v3
19+
!default.mode2v3
20+
*.perspectivev3
21+
!default.perspectivev3
122
xcuserdata
2-
*.js.map
3-
node_modules
23+
*.xccheckout
24+
*.moved-aside
25+
DerivedData
26+
*.hmap
27+
*.ipa
28+
*.xcuserstate
29+
project.xcworkspace
30+
31+
32+
# Android
33+
#
34+
35+
# Built application files
36+
*.apk
37+
*.ap_
38+
39+
# Files for the Dalvik VM
40+
*.dex
41+
42+
# Java class files
43+
*.class
44+
45+
# Generated files
46+
bin/
47+
gen/
48+
49+
# Gradle files
50+
.gradle/
51+
build/
52+
/*/build/
53+
54+
# IntelliJ files
55+
.idea
56+
*.iml
57+
58+
# Local configuration file (sdk path, etc)
59+
local.properties
60+
61+
# Proguard folder generated by Eclipse
62+
proguard/
63+
64+
# Log Files
65+
*.log
66+
67+
# Visual Studio Code
68+
.vscode

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SearchBarExample
1+
example

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,113 @@
1-
# react-native-search-bar
1+
<h2 align="center">React Native Search Bar</h2>
22

3-
<a href="https://www.npmjs.com/package/react-native-search-bar"><img src="https://badge.fury.io/js/react-native-search-bar.svg" alt="" height="18"></a>
3+
<p align="center">The high-quality
4+
<a href="https://developer.apple.com/documentation/uikit/uisearchbar">native iOS search bar</a> for <a href="https://facebook.github.io/react-native/">react native.</a>
45

5-
The high-quality [iOS native search bar](https://developer.apple.com/documentation/uikit/uisearchbar) for [react native](https://facebook.github.io/react-native/).
6+
<p align="center">
7+
<a href="https://www.npmjs.com/package/react-native-search-bar">
8+
<img alt="npm version" src="https://img.shields.io/npm/v/react-native-search-bar.svg?style=flat-square">
9+
</a>
10+
<a href="https://www.npmjs.com/package/react-native-react-native-search-bar">
11+
<img alt="npm downloads" src="https://img.shields.io/npm/dm/react-native-search-bar.svg?style=flat-square">
12+
</a>
13+
<a href="https://prettier.io">
14+
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square">
15+
</a>
16+
</p>
617

7-
<img src="SearchBar.png"/>
18+
<p align="center">
19+
<img src="./.github/SearchBar.png"/>
20+
</p>
821

9-
:sunny: Battle-tested in [WeatherEh](https://itunes.apple.com/us/app/id1112813447) app.
22+
<br>
1023

11-
## Installation
24+
## Getting Started
1225

13-
In your react native project, run `npm install react-native-search-bar --save` or `yarn add react-native-search-bar`
26+
1. Installation
1427

15-
To link this library, please follow the first two steps in the [Linking Libraries (iOS)](http://facebook.github.io/react-native/docs/linking-libraries-ios.html) guide on React Native website. The `.xcodeproj` file is in `node_modules/react-native-search-bar/`. In the end, you should have `RNSearchBar.xcodeproj` in the `Libaries` group on Xcode and `libRNSearchBar.a` in the `Link Binary With Libraries` section inside the `Build Phases` tab of your project target.
28+
* Using npm: `npm install react-native-tableview --save`
29+
* Using yarn: `yarn add react-native-tableview`
30+
31+
2. Link
32+
* Run `react-native link react-native-search-bar`
33+
* If linking fails, follow the
34+
[manual linking steps](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking)
1635

1736
## Update
1837

1938
In your react native project, run
2039

2140
```Bash
22-
npm install react-native@latest --save # optional, just for the latest react-native
41+
# npm
2342
npm install react-native-search-bar@latest --save
43+
44+
# yarn
45+
yarn add react-native-search-bar@latest
2446
```
2547

2648
## Usage
2749

2850
```javascript
29-
var SearchBar = require('react-native-search-bar');
51+
import SearchBar from 'react-native-search-bar'
3052
```
3153

3254
```JSX
3355
<SearchBar
34-
ref='searchBar'
35-
placeholder='Search'
36-
onChangeText={...}
37-
onSearchButtonPress={...}
38-
onCancelButtonPress={...}
39-
/>
56+
ref='searchBar'
57+
placeholder='Search'
58+
onChangeText={...}
59+
onSearchButtonPress={...}
60+
onCancelButtonPress={...}
61+
/>
4062
```
4163

4264
### Managing the keyboard
65+
4366
* Show - `this.refs.searchBar.focus();`
4467
* Hide
45-
- `this.refs.searchBar.blur();` - uses the iOS `endEditing:true` method on the underlying `UISearchBar` view.
46-
- `this.refs.searchBar.unFocus();` - calls `resignFirstResponder` on the `UITextField` used by the `UISearchBar`.
47-
* Examples
48-
* Show the keyboard when the view loads:
68+
* `this.refs.searchBar.blur();` - uses the iOS `endEditing:true` method on the
69+
underlying `UISearchBar` view.
70+
* `this.refs.searchBar.unFocus();` - calls `resignFirstResponder` on the
71+
`UITextField` used by the `UISearchBar`.
72+
73+
### Examples
74+
75+
* Show the keyboard when the view loads:
76+
4977
```javascript
5078
componentDidMount() {
5179
this.refs.searchBar.focus();
5280
}
5381
```
54-
* Hide the keyboard when the user searches:
82+
83+
* Hide the keyboard when the user searches:
84+
5585
```javascript
5686
...
5787
onSearchButtonPress={this.refs.searchBar.unFocus}
5888
...
5989
```
6090

61-
For all supportted properties, please check out `propTypes` in either [SearchBar.coffee](SearchBar.coffee) or [SearchBar.js](SearchBar.js).
91+
For a full list of props check out
92+
[the typescript definitions file](./src/index.d.ts).
6293

63-
There is also an example project in the [SearchBarExample](SearchBarExample) directory.
94+
There is also an example project in the [example](./example) directory.
6495

6596
## Contribution
6697

67-
For now, implemented are only some of the features of [UISearchBar](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISearchBar_Class/).
68-
Feel free to send a pull request. To get started, you can read the ["Native UI Components (iOS)"](http://facebook.github.io/react-native/docs/native-components-ios.html) guide on React Native website.
98+
For now, only some of the features of
99+
[UISearchBar](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISearchBar_Class/)
100+
are implemented.
101+
102+
Feel free to send a pull request to the
103+
[next](https://github.com/umhan35/react-native-search-bar/tree/next) branch. To
104+
get started, you can read the
105+
["Native UI Components (iOS)"](http://facebook.github.io/react-native/docs/native-components-ios.html)
106+
guide on the React Native website.
69107

70-
Except code contribution, you are welcome to answer question asked in [Issues](https://github.com/umhan35/react-native-search-bar/issues).
108+
Along with code contribution, you are welcomed to answer questions asked in the
109+
[Issues](https://github.com/umhan35/react-native-search-bar/issues).
71110

72111
## License
73112

74113
MIT
75-
76-

RNSearchBar.m

Lines changed: 0 additions & 86 deletions
This file was deleted.

RNSearchBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)