Skip to content

Commit 9113513

Browse files
committed
2 parents 438ac37 + d9b3ffe commit 9113513

File tree

74 files changed

+9750
-6136
lines changed

Some content is hidden

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

74 files changed

+9750
-6136
lines changed

.babelrc

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

.babelrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = function(api) {
2+
const plugins = [
3+
'@babel/plugin-syntax-dynamic-import',
4+
'@babel/plugin-proposal-export-default-from',
5+
'@babel/plugin-proposal-export-namespace-from',
6+
'@babel/plugin-proposal-object-rest-spread',
7+
'babel-plugin-flow-react-proptypes',
8+
'@babel/plugin-proposal-class-properties',
9+
]
10+
const presets = [
11+
[
12+
'@babel/preset-env',
13+
api.env('es5')
14+
? { forceAllTransforms: true }
15+
: { targets: { node: 'current' } },
16+
],
17+
'@babel/preset-react',
18+
'@babel/preset-flow',
19+
]
20+
21+
if (api.env(['test', 'coverage', 'es5'])) {
22+
plugins.push('@babel/plugin-transform-runtime')
23+
}
24+
if (api.env('coverage')) {
25+
plugins.push('babel-plugin-istanbul')
26+
}
27+
28+
return { plugins, presets }
29+
}

.eslintrc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"extends": [
3-
"@jedwards1211/eslint-config-react", "@jedwards1211/eslint-config-flow"
3+
"@jedwards1211/eslint-config-react",
4+
"@jedwards1211/eslint-config-flow",
5+
"eslint-config-prettier"
46
],
5-
"parser": "babel-eslint"
7+
"parser": "babel-eslint",
8+
"parserOptions": {
9+
"ecmaVersion": 6,
10+
"sourceType": "module"
11+
},
12+
"env": {
13+
"es6": true
14+
}
615
}

.flowconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
[ignore]
2+
<PROJECT_ROOT>/es/.*
3+
<PROJECT_ROOT>/lib/.*
4+
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
25
<PROJECT_ROOT>/node_modules/fbjs/.*
36
<PROJECT_ROOT>/node_modules/.*/tests?/.*\.json
47
<PROJECT_ROOT>/node_modules/immutable/dist/immutable.js.flow
5-
<PROJECT_ROOT>/lib
8+
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
69

710
[include]
811
./src
@@ -14,4 +17,3 @@
1417
module.system=node
1518
esproposal.class_static_fields=enable
1619
esproposal.class_instance_fields=enable
17-

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
.eslintcache
12
.nyc_output
23
coverage
3-
node_modules
4+
es
45
lib
5-
.eslintcache
6+
node_modules

.npmignore

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
.babelrc
22
.eslintrc
3+
.eslintcache
4+
.eslintrc
5+
.idea
36
.nyc_output
7+
.prettierrc
48
.storybook
59
.travis.yml
10+
commitlint.config.js
611
coverage
12+
flow-typed
13+
lib
714
node_modules
8-
test
9-
stories
10-
.eslintcache
11-
.idea
12-
solano.yml
1315
renovate.json
14-
commitlint.config.js
15-
flow-typed
16-
16+
solano.yml
17+
src
18+
stories
19+
test

.prettierrc

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

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ cache:
55
notifications:
66
email: false
77
node_js:
8+
- '10'
89
- '8'
9-
- '7'
1010
- '6'
1111
install:
1212
- yarn install --ignore-engines --check-files --frozen-lockfile

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
[![Coverage Status](https://codecov.io/gh/jcoreio/redux-form-numeric-field/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/redux-form-numeric-field)
55
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
66
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
7+
[![npm version](https://badge.fury.io/js/redux-form-numeric-field.svg)](https://badge.fury.io/js/redux-form-numeric-field)
78

8-
A customized `redux-form` `Field` for entering numbers. It isn't contrary; it won't stop you from typing, pasting, or cutting
9+
A customized `redux-form` `Field` for entering numbers. It isn't contrary; it won't stop you from typing, pasting, or cutting
910
any characters.
1011
When it loses focus it will normalize its value to a number, if valid; otherwise it will trim its value but leave it as a string,
1112
and produce a "must be a number" validation error.
@@ -17,21 +18,21 @@ npm install --save redux-form-numeric-field
1718
```
1819

1920
```js
20-
const {NumericField} = require('redux-form-numeric-field')
21+
const { NumericField } = require('redux-form-numeric-field')
2122
```
23+
2224
or
25+
2326
```js
24-
const {NumericField} = require('redux-form-numeric-field/immutable')
27+
const { NumericField } = require('redux-form-numeric-field/immutable')
2528
```
2629

2730
## Example
2831

2932
The following field will trim its text when it loses focus:
33+
3034
```js
31-
<NumericField
32-
name="name"
33-
component={YourInputComponent}
34-
/>
35+
<NumericField name="name" component={YourInputComponent} />
3536
```
3637

3738
## API
@@ -43,7 +44,7 @@ Has the same API as `redux-form`'s `Field`, but normalizes its value to a number
4344

4445
#### `normalizeNumber?: (value: ?(string | number)) => ?(string | number)`
4546

46-
Allows you to override the default implementation which is called on blur. If `value` is a `number` or
47+
Allows you to override the default implementation which is called on blur. If `value` is a `number` or
4748
correctly-formatted `string`, return a `number`; otherwise, return a `string` or `null`.
4849

4950
#### `normalizeOnBlur?: (value: ?(string | number)) => ?(string | number)`
@@ -53,5 +54,5 @@ If you provide this, it will be called with the output of `normalizeNumber`.
5354
#### `validate?: Validator | Array<Validator>`
5455

5556
Unlike a normal `Field`, `NumericField` will call your validators with the normalized value from
56-
`normalizeNumber`. If its value is an invalid number but not whitespace, it will produce a
57+
`normalizeNumber`. If its value is an invalid number but not whitespace, it will produce a
5758
"must be a number" validation error without calling your own validators.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// flow-typed signature: c7350111bb8d1ce7ea1d0a78b76eb104
2+
// flow-typed version: <<STUB>>/@babel/cli_v^7.1.5/flow_v0.86.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* '@babel/cli'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module '@babel/cli' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module '@babel/cli/bin/babel-external-helpers' {
26+
declare module.exports: any;
27+
}
28+
29+
declare module '@babel/cli/bin/babel' {
30+
declare module.exports: any;
31+
}
32+
33+
declare module '@babel/cli/lib/babel-external-helpers' {
34+
declare module.exports: any;
35+
}
36+
37+
declare module '@babel/cli/lib/babel/dir' {
38+
declare module.exports: any;
39+
}
40+
41+
declare module '@babel/cli/lib/babel/file' {
42+
declare module.exports: any;
43+
}
44+
45+
declare module '@babel/cli/lib/babel/index' {
46+
declare module.exports: any;
47+
}
48+
49+
declare module '@babel/cli/lib/babel/options' {
50+
declare module.exports: any;
51+
}
52+
53+
declare module '@babel/cli/lib/babel/util' {
54+
declare module.exports: any;
55+
}
56+
57+
// Filename aliases
58+
declare module '@babel/cli/bin/babel-external-helpers.js' {
59+
declare module.exports: $Exports<'@babel/cli/bin/babel-external-helpers'>;
60+
}
61+
declare module '@babel/cli/bin/babel.js' {
62+
declare module.exports: $Exports<'@babel/cli/bin/babel'>;
63+
}
64+
declare module '@babel/cli/index' {
65+
declare module.exports: $Exports<'@babel/cli'>;
66+
}
67+
declare module '@babel/cli/index.js' {
68+
declare module.exports: $Exports<'@babel/cli'>;
69+
}
70+
declare module '@babel/cli/lib/babel-external-helpers.js' {
71+
declare module.exports: $Exports<'@babel/cli/lib/babel-external-helpers'>;
72+
}
73+
declare module '@babel/cli/lib/babel/dir.js' {
74+
declare module.exports: $Exports<'@babel/cli/lib/babel/dir'>;
75+
}
76+
declare module '@babel/cli/lib/babel/file.js' {
77+
declare module.exports: $Exports<'@babel/cli/lib/babel/file'>;
78+
}
79+
declare module '@babel/cli/lib/babel/index.js' {
80+
declare module.exports: $Exports<'@babel/cli/lib/babel/index'>;
81+
}
82+
declare module '@babel/cli/lib/babel/options.js' {
83+
declare module.exports: $Exports<'@babel/cli/lib/babel/options'>;
84+
}
85+
declare module '@babel/cli/lib/babel/util.js' {
86+
declare module.exports: $Exports<'@babel/cli/lib/babel/util'>;
87+
}

0 commit comments

Comments
 (0)