Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ node_modules
coverage

# production
build
/dist
/storybook-static

# misc
.DS_Store
.env
npm-debug.log
package-lock.json
1,520 changes: 1,226 additions & 294 deletions dist/index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"material-ui": "^0.17.0",
"react": "15.4.2",
"react-dom": "15.4.2",
"react-number-input": "file:../",
"react-tap-event-plugin": "^2.0.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions example/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import TextField from 'material-ui/TextField';
import NumberInput from '../../dist/index.js';
import NumberInput from '../../dist/index';
import './App.css';

class App extends Component {
Expand Down Expand Up @@ -36,7 +36,7 @@ class App extends Component {
<p>NumberInput with thousand separators</p>
<NumberInput value={this.state.year} />
<p>NumberInput with decimal points (2 significant places)</p>
<NumberInput value={this.state.PI} format="0.00" />
<NumberInput value={199.99} format="$0.00" min={0} max={300}/>
<p>Custom renderer</p>
<NumberInput
value={this.state.PI}
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-number-input",
"version": "15.5.0",
"version": "15.6.0",
"description": "<input /> for numbers, currency and other important numbers",
"main": "dist/index.js",
"author": "hongymagic",
Expand All @@ -21,7 +21,7 @@
"currency"
],
"scripts": {
"build": "babel index.js -d dist",
"build": "webpack -d",
"flow": "flow",
"test": "jest",
"storybook": "start-storybook -p 6006",
Expand All @@ -36,10 +36,12 @@
},
"dependencies": {
"babel-jest": "^19.0.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.23.0",
"numbro": "^1.10.1",
"react": "^0.14 || ^15.0.0-rc || ^15.0",
"react-dom": "^0.14 || ^15.0.0-rc || ^15.0"
"react-dom": "^0.14 || ^15.0.0-rc || ^15.0",
"webpack": "^3.10.0"
},
"devDependencies": {
"@kadira/storybook": "^2.21.0",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion index.test.js → src/react-number-input.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import numbro from 'numbro';
import NumberInput from './index';
import NumberInput from './react-number-input';
import { shallow } from 'enzyme';

const testInitialFormat = states => {
Expand Down
6 changes: 3 additions & 3 deletions stories/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import NumberInput from '../index.js';
import React from 'react'
import { storiesOf, action } from '@kadira/storybook'
import NumberInput from '../dist/index'

storiesOf('NumberInput', module)
.add('without any properties', () => (
Expand Down
23 changes: 23 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var path = require('path')
var libraryName = require('./package.json').name
var outputFile = libraryName + '.js'

module.exports = {
devtool: 'eval-source-map',
entry: [path.join(__dirname, 'src/' + outputFile)],
output: {
path: path.join(__dirname, 'dist'),
filename: 'index.js',
library: libraryName,
libraryTarget: 'umd',
},
module: {
loaders: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/,
},
],
}
}