Skip to content

Commit e187041

Browse files
committed
Version 1.0.3, Fixed some issues
1 parent 556796e commit e187041

File tree

5 files changed

+34
-25
lines changed

5 files changed

+34
-25
lines changed

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"react": "16.8.3",
1313
"react-dom": "^16.8.6",
1414
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
15-
"react-native-input-validator": "^1.0.1",
15+
"react-native-input-validator": "^1.0.3",
1616
"react-native-web": "^0.11.4",
1717
"validator": "^11.1.0"
1818
},

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# React Native Input Validator
2-
### react-native-input-validator
2+
## `react-native-input-validator`
3+
4+
*Compatible with: Android, iOS, Windows, Web and Expo*
35

46
[![NPM version][npm-image]][npm-url]
57
[![npm download][download-image]][download-url]
@@ -14,12 +16,17 @@
1416

1517
**Author:** Marco Cesarato
1618

17-
## Description
19+
## 📘 Description
1820

1921
This library validates strings and number passed on TextInput component and highlight the result (valid green, invalid red).
2022

23+
## 🎨 Screenshots
24+
25+
<img src="screenshots/example.png" />
2126

22-
## Install
27+
## 📖 Install
28+
29+
Just run the following command line:
2330

2431
### npm
2532
```shell
@@ -31,28 +38,28 @@ npm install react-native-input-validator --save
3138
yarn add react-native-input-validator
3239
```
3340

34-
## Usage
41+
## 💻 Usage
3542

3643
### Require
3744

3845

3946
```javascript
40-
include TextInput from 'react-native-input-validator';
47+
import TextInput from 'react-native-input-validator';
4148
```
4249

4350
### Examples
4451

45-
4652
#### Placeholder floating label
4753
```javascript
4854
// Require
49-
include TextInput from 'react-native-input-validator';
55+
import TextInput from 'react-native-input-validator';
5056

5157
// Example
5258
<InputValidator
5359
ref={(r) => {
5460
this.input = r;
5561
}}
62+
type="email"
5663
value={this.state.value}
5764
style={styles.input}
5865
onChangeText={(text) => {this.setState({value: text})}}>
@@ -69,13 +76,14 @@ this.input.isValid();
6976
#### Only text input
7077
```javascript
7178
// Require
72-
include TextInput from 'react-native-input-validator';
79+
import TextInput from 'react-native-input-validator';
7380

7481
// Example
7582
<InputText
7683
ref={(r) => {
7784
this.input = r;
7885
}}
86+
type="email"
7987
value={this.state.value}
8088
style={styles.input}
8189
onChangeText={(text) => {this.setState({value: text})}} />
@@ -85,7 +93,7 @@ this.input.isValidated(); // Faster
8593
this.input.isValid();
8694
```
8795

88-
## Run example
96+
## ⚡️ Run example
8997
Clone or download repo and after:
9098
```shell
9199
cd Example
@@ -95,12 +103,7 @@ expo start
95103

96104
Open Expo Client on your device. Use it to scan the QR code printed by `expo start`. You may have to wait a minute while your project bundles and loads for the first time.
97105

98-
## Screenshots
99-
100-
### Example
101-
<img src="screenshots/example.png" />
102-
103-
## Types
106+
## 📘 Types
104107

105108
- email
106109
- phone
@@ -117,12 +120,14 @@ Open Expo Client on your device. Use it to scan the QR code printed by `expo sta
117120
- alpha
118121
- alphanumeric
119122

120-
## Handlers
123+
## 💡 Props
124+
125+
### Handlers
121126

122127
Same of `TextInput`.
123128
Read more here: https://facebook.github.io/react-native/docs/textinput.html
124129

125-
## Props
130+
### Props
126131

127132
Same of `TextInput`.
128133
Read more here: https://facebook.github.io/react-native/docs/textinput.html
@@ -133,12 +138,16 @@ type | Type of input | String | `dafault` | |
133138
symbol | Symbol for `currency` type | String | | |
134139
locale | For better validation can be useful for some type like `postal-code`, `identity-card` etc... | String | | Locale is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-FR', 'hu-HU', 'it-IT', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']` |
135140

136-
## Props style
141+
### Props Styles
137142

138143
Property | Description | Type | Default | Note
139144
------------------|-------------|------|---------|-------
140145
style | Input style | Object | | |
141146
labelStyle | Label Style (placeholder) | Object | | Only using `InputValidator` |
142147
containerStyle | Container Style | Object | | Only using `InputValidator` |
143148
validStyle | Input Style when valid | Object | |
144-
invalidStyle | Input Style when invalid | Object | |
149+
invalidStyle | Input Style when invalid | Object | |
150+
151+
## 🤔 How to contribute
152+
Have an idea? Found a bug? Please raise to [ISSUES](https://github.com/marcocesarato/react-native-input-validator/issues).
153+
Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-input-validator",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "React native input with floating label and data validation",
55
"main": "index.js",
66
"scripts": {

src/InputValidator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class InputValidator extends Component {
359359
}
360360
}
361361

362-
InputText.propTypes = {
362+
InputValidator.propTypes = {
363363
type: PropTypes.string,
364364
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
365365
symbol: PropTypes.string,
@@ -372,7 +372,7 @@ InputText.propTypes = {
372372
secureTextEntry: PropTypes.bool,
373373
};
374374

375-
InputText.defaultProps = {
375+
InputValidator.defaultProps = {
376376
type: 'default'
377377
};
378378

src/InputValidatorPlaceholder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ class InputValidatorPlaceholder extends InputValidator {
162162
}
163163
}
164164

165-
InputValidator.propTypes = {
165+
InputValidatorPlaceholder.propTypes = {
166166
labelStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
167167
containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
168168
};
169169

170-
InputValidator.defaultProps = {
170+
InputValidatorPlaceholder.defaultProps = {
171171
placeholder: "",
172172
containerstyle: {},
173173
labelstyle: {},

0 commit comments

Comments
 (0)