This repository has been archived by the owner on Jul 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from schneidmaster/es6
Convert to ES6, update for latest package versions
- Loading branch information
Showing
9 changed files
with
3,813 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["es2015", "react"], | ||
"comments": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
index.js | ||
lib/ | ||
node_modules/ | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { FormGroup, ControlLabel } from 'react-bootstrap'; | ||
import MaskedFormControl from '../src'; | ||
|
||
const Example = () => { | ||
return ( | ||
<div className='container'> | ||
<h1>Example</h1> | ||
|
||
<FormGroup> | ||
<ControlLabel>Phone Number</ControlLabel> | ||
<MaskedFormControl type='text' name='phoneNumber' mask='111-111-1111' /> | ||
</FormGroup> | ||
</div> | ||
); | ||
} | ||
|
||
const rootDiv = document.createElement('div'); | ||
document.body.appendChild(rootDiv); | ||
ReactDOM.render(<Example />, rootDiv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import webpack from 'webpack'; | ||
|
||
import HtmlWebpackPlugin from 'html-webpack-plugin'; | ||
import HtmlWebpackIncludeAssetsPlugin from 'html-webpack-include-assets-plugin'; | ||
|
||
export default { | ||
entry: './example/index.js', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
use: 'babel-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin(), | ||
new HtmlWebpackIncludeAssetsPlugin({ | ||
assets: ['https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css'], | ||
append: true | ||
}) | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
import MaskedInput from 'react-maskedinput'; | ||
import { FormControl } from 'react-bootstrap'; | ||
|
||
export default class MaskedFormControl extends FormControl { | ||
render() { | ||
const props = Object.assign({}, this.props, { componentClass: MaskedInput }); | ||
|
||
return React.createElement(FormControl, props); | ||
} | ||
} | ||
|
||
// FormControl has a componentClass prop which | ||
// MaskedFormControl always overrides to be a | ||
// MaskedInput. | ||
delete MaskedFormControl.propTypes.componentClass; |
Oops, something went wrong.