react-imask
Advanced tools
Comparing version
{ | ||
"name": "react-imask", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "React input mask", | ||
"main": "index.js", | ||
"main": "dist/react-imask.js", | ||
"module": "src/index.js", | ||
"scripts": { | ||
"test": "npm run test" | ||
"test": "npm run test", | ||
"build": "rollup -c", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -19,4 +22,29 @@ "repository": { | ||
], | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"author": "Alexey Kryazhev", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"dependencies": { | ||
"imask": "latest", | ||
"prop-types": "^15.6.0" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=0.14.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-transform-object-assign": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"rollup": "^0.52.0", | ||
"rollup-plugin-babel": "^3.0.2", | ||
"rollup-plugin-eslint": "^4.0.0" | ||
}, | ||
"engines": { | ||
"npm": ">=4.0.0" | ||
}, | ||
"homepage": "https://unmanner.github.io/imaskjs/" | ||
} |
@@ -1,4 +0,59 @@ | ||
# react-imask | ||
React input mask | ||
# React IMask Plugin | ||
react-imask | ||
## TODO | ||
[](https://badge.fury.io/js/react-imask) | ||
[](https://opensource.org/licenses/MIT) | ||
## Install | ||
`npm install react-imask` | ||
## Mask input example | ||
```javascript | ||
import {IMaskInput} from 'react-imask'; | ||
<IMaskInput | ||
mask=Number, | ||
radix=".", | ||
value="123", // possible to use `unmaskedValue`, but not both | ||
onAccept={ | ||
// first argument is `value` or `unmaskedValue` depending on prop above | ||
(value, mask) => console.log(value) | ||
}, | ||
// ...and more mask props in a guide | ||
// input props also available | ||
placeholder='Enter number here' | ||
/> | ||
``` | ||
## Extend existing components | ||
```javascript | ||
import {IMaskMixin} from 'react-imask'; | ||
// extend style component | ||
const StyledInput = styled.input` | ||
color: paleviolet; | ||
`; | ||
const MaskedStyledInput = IMaskMixin(({inputRef, ...props}) => ( | ||
<StyledInput | ||
...props, | ||
innerRef={inputRef} // bind internal input | ||
/> | ||
)); | ||
<MaskedStyledInput | ||
mask=Number, | ||
radix=".", | ||
onAccept={(value, mask) => console.log(value)}, | ||
// ...and more mask props in a guide | ||
// ...other styled props | ||
/> | ||
``` | ||
More options see in a [guide](https://unmanner.github.io/imaskjs/guide.html). | ||
## Many thanks to | ||
[@Yordis Prieto](https://github.com/yordis) | ||
[@Alexander Kiselev](https://github.com/MaaKut) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
24251
5092.93%8
300%308
Infinity%1
-50%60
1100%3
Infinity%8
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added