├── example
├── README.md
├── typings.json
├── tsconfig.json
├── package.json
├── webpack.config.js
└── index.tsx
├── src
├── index.tsx
└── NumberInput.tsx
├── .npmignore
├── Dev
├── index.tsx
└── demo.tsx
├── tsconfig.json
├── server.js
├── webpack.config.js
├── .gitignore
├── LICENSE
├── package.json
├── README.md
└── CHANGELOG.md
/example/README.md:
--------------------------------------------------------------------------------
1 | ```
2 | npm install
3 | npm start
4 | // Open ./demo/index.html in your favorite browser
5 | ```
6 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import NumberInput from './NumberInput';
2 | export * from './NumberInput';
3 | export default NumberInput;
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | demo
2 | example
3 | node_modules
4 | src
5 | Dev
6 | screenshots
7 | typings
8 | .git
9 | .vscode
10 | index.html
11 | server.js
12 | tsconfig.json
13 | typings.json
14 | webpack.config.js
15 |
--------------------------------------------------------------------------------
/example/typings.json:
--------------------------------------------------------------------------------
1 | {
2 | "globalDependencies": {
3 | "node": "registry:dt/node",
4 | "react": "registry:dt/react",
5 | "react-dom": "registry:dt/react-dom",
6 | "react-tap-event-plugin": "registry:dt/react-tap-event-plugin",
7 | "material-ui": "registry:dt/material-ui"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Dev/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { render as ReactDomRender } from 'react-dom';
3 | import * as injectTapEventPlugin from 'react-tap-event-plugin';
4 | import Demo from './demo';
5 |
6 | injectTapEventPlugin();
7 | let bootstrapNode = document.createElement('div');
8 | ReactDomRender(, bootstrapNode);
9 | document.body.appendChild(bootstrapNode);
--------------------------------------------------------------------------------
/example/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "moduleResolution": "node",
5 | "target": "es5",
6 | "jsx": "react",
7 | "noImplicitAny": true
8 | },
9 | "files": [
10 | "typings/index.d.ts",
11 | "index.tsx"
12 | ],
13 | "exclude": [
14 | "node_modules"
15 | ]
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es5",
5 | "noImplicitAny": true,
6 | "strictNullChecks": true,
7 | "noImplicitThis": true,
8 | "noUnusedParameters": true,
9 | "noUnusedLocals": true,
10 | "experimentalDecorators": true,
11 | "jsx": "react"
12 | },
13 | "include": [
14 | "src/**/*"
15 | ],
16 | "exclude": [
17 | "node_modules"
18 | ]
19 | }
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "./demo/index.html",
3 | "scripts": {
4 | "test": "echo \"Error: no test specified\" && exit 1",
5 | "postinstall": "typings install",
6 | "start": "webpack"
7 | },
8 | "author": "Ivo Stratev",
9 | "license": "MIT",
10 | "dependencies": {
11 | "material-ui": "^0.15.4",
12 | "react": "^15.3.1",
13 | "react-dom": "^15.3.1",
14 | "react-tap-event-plugin": "^1.0.0",
15 | "material-ui-number-input": "^5.0.0"
16 | },
17 | "devDependencies": {
18 | "html-webpack-plugin": "^2.22.0",
19 | "ts-loader": "^0.8.2",
20 | "typescript": "^1.8.10",
21 | "typings": "^1.3.1",
22 | "webpack": "^1.13.1"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var express = require('express');
3 | var webpack = require('webpack');
4 | var config = require('./webpack.config');
5 |
6 | config.plugins.pop();
7 |
8 | var app = express();
9 | var compiler = webpack(config);
10 |
11 | app.use(require('webpack-dev-middleware')(compiler, {
12 | noInfo: true,
13 | publicPath: config.output.publicPath
14 | }));
15 |
16 | app.use(require('webpack-hot-middleware')(compiler));
17 |
18 | app.get('*', function (req, res) {
19 | res.sendFile(path.join(__dirname, 'index.html'));
20 | });
21 |
22 | app.listen(3000, 'localhost', function (err) {
23 | if (err) {
24 | console.log(err);
25 | return;
26 | }
27 |
28 | console.log('Listening at http://localhost:3000');
29 | });
30 |
--------------------------------------------------------------------------------
/example/webpack.config.js:
--------------------------------------------------------------------------------
1 | const HtmlWebpackPlugin = require('html-webpack-plugin');
2 | const webpack = require('webpack');
3 | const path = require('path');
4 |
5 | module.exports = {
6 | entry: [
7 | "./index.tsx"
8 | ],
9 |
10 | output: {
11 | path: path.join(__dirname, "demo"),
12 | filename: "[name].js",
13 | publicPath: ''
14 | },
15 |
16 | plugins: [
17 | new HtmlWebpackPlugin({ title: "Material-Ui NumberInput" })
18 | ],
19 |
20 | resolve: {
21 | extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
22 | },
23 |
24 | module: {
25 | loaders: [
26 | {
27 | test: /\.tsx?$/,
28 | loaders: ["ts-loader"]
29 | }
30 | ],
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const HtmlWebpackPlugin = require('html-webpack-plugin');
2 | const webpack = require('webpack');
3 | const path = require('path');
4 |
5 | module.exports = {
6 | entry: [
7 | 'webpack-hot-middleware/client',
8 | "./Dev/index.tsx"
9 | ],
10 |
11 | output: {
12 | path: path.join(__dirname, "demo"),
13 | filename: "[name].js",
14 | publicPath: ''
15 | },
16 |
17 | plugins: [
18 | new webpack.HotModuleReplacementPlugin(),
19 | new HtmlWebpackPlugin({ title: "Material-Ui Number Input" })
20 | ],
21 |
22 | resolve: {
23 | extensions: [".ts", ".tsx", ".js"]
24 | },
25 |
26 | module: {
27 | loaders: [
28 | {
29 | test: /\.tsx?$/,
30 | loaders: ["ts-loader"]
31 | }
32 | ],
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # nyc test coverage
18 | .nyc_output
19 |
20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21 | .grunt
22 |
23 | # node-waf configuration
24 | .lock-wscript
25 |
26 | # Compiled binary addons (http://nodejs.org/api/addons.html)
27 | build/Release
28 |
29 | # Dependency directories
30 | node_modules
31 | jspm_packages
32 |
33 | # Optional npm cache directory
34 | .npm
35 |
36 | # Optional REPL history
37 | .node_repl_history
38 |
39 | # typings
40 | typings
41 |
42 | # d*
43 | dist
44 | demo
45 |
46 | # index.html
47 | index.*
48 |
49 | NumberInput.*
50 |
51 | # vscode
52 | .vscode
53 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Ivo Stratev
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "material-ui-number-input",
3 | "version": "5.0.24",
4 | "description": "The better TextField for number inputs.",
5 | "main": "./index.js",
6 | "typings": "./index.d.ts",
7 | "scripts": {
8 | "test": "tsc",
9 | "start": "webpack && mv ./demo/index.html ./ && node server.js",
10 | "npm": "tsc -d -p . && mv ./src/*.js . && mv ./src/*.d.ts .",
11 | "clean": "rm ./src/*.js"
12 | },
13 | "keywords": [
14 | "react",
15 | "material-ui",
16 | "input",
17 | "number",
18 | "ux",
19 | "material-design",
20 | "input-number",
21 | "user-expects"
22 | ],
23 | "author": "Ivo Stratev",
24 | "license": "MIT",
25 | "repository": {
26 | "type": "git",
27 | "url": "git+https://github.com/NoHomey/material-ui-number-input.git"
28 | },
29 | "peerDependencies": {
30 | "material-ui": "^0.18.6",
31 | "react": "^15.6.1",
32 | "react-dom": "^15.6.1",
33 | "react-tap-event-plugin": "^2.0.1"
34 | },
35 | "devDependencies": {
36 | "@types/material-ui": "^0.17.17",
37 | "@types/node": "^8.0.14",
38 | "@types/object-assign": "^4.0.30",
39 | "@types/prop-types": "^15.5.1",
40 | "@types/react": "^15.0.38",
41 | "@types/react-dom": "^15.5.1",
42 | "@types/react-tap-event-plugin": "^0.0.30",
43 | "express": "^4.15.3",
44 | "html-webpack-plugin": "^2.29.0",
45 | "material-ui": "^0.18.6",
46 | "react": "^15.6.1",
47 | "react-dom": "^15.6.1",
48 | "react-hot-loader": "^1.3.1",
49 | "react-tap-event-plugin": "^2.0.1",
50 | "ts-loader": "^2.3.1",
51 | "typescript": "^2.4.2",
52 | "webpack": "^2.3.3",
53 | "webpack-dev-middleware": "^1.11.0",
54 | "webpack-hot-middleware": "^2.18.2"
55 | },
56 | "dependencies": {
57 | "bind-decorator": "^1.0.11",
58 | "object-assign": "^4.1.1",
59 | "prop-types": "^15.5.10"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Dev/demo.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
3 | import { NumberInput, NumberInputChangeHandler, NumberInputError, NumberInputErrorHandler, NumberInputValidHandler, NumberInputReqestValueHandller } from './../src/index';
4 |
5 | interface DemoState {
6 | value?: string;
7 | errorText?: string;
8 | }
9 |
10 | export default class Demo extends React.Component