Skip to content

Commit 63fede4

Browse files
committed
Initial Commit
1 parent 9c3682a commit 63fede4

11 files changed

+71
-46
lines changed

.gitignore

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
.DS_Store
22
node_modules/
3-
/dist/
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
3+
*.map
74
/test/unit/coverage/
8-
9-
# Editor directories and files
10-
.idea
11-
.vscode
12-
*.suo
13-
*.ntvs*
14-
*.njsproj
15-
*.sln
5+
package-lock.json

.npmignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
build
2+
config
3+
docs
4+
node_modules
5+
static
6+
.babelrc
7+
.editorconfig
8+
.gitignore
9+
.eslingrc.js
10+
.postcssrc.js
11+
package-lock.json
12+
*.iml
13+
.idea
14+
test/unit/coverage/

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- "node"
4+
script:
5+
- npm run lint
6+
- npm run build
7+
- npm test

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright 2018-present Jayesh Vachhani
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
## Vue Numeric Input
1+
# Vue Numeric Input
22

3-
Number input component based on Vue that is a replacement of native input number which has optional control.
3+
Number input component based on Vue that is a replacement of native input number with optional control.
44

5-
![vue-numeric-input](https://user-images.githubusercontent.com/36194663/44716977-6988d380-aad9-11e8-96df-a2605182076d.gif)
5+
![vue-numeric-input](https://user-images.githubusercontent.com/36194663/44717643-33e4ea00-aadb-11e8-82bf-e1fdeeea3bb5.gif)
66

7+
[Live Demo](https://jayeshlab.github.io/vue-numeric-input/)
78

8-
###Installation
9+
### Installation
910

1011
Install via NPM
1112

1213
`$ npm install vue-numeric-input --save`
1314

15+
Install via CDN
16+
17+
```
18+
<script src="https://unpkg.com/vue"></script>
19+
<script src="https://unpkg.com/vue-numeric-input"></script>
20+
21+
```
1422

1523
#### Global
1624

17-
You may install VueNumericInput globally:
25+
Register VueNumericInput globally:
1826

1927
```
2028
import Vue from 'Vue';
@@ -58,7 +66,7 @@ export default {
5866
</script>
5967
```
6068

61-
### PROPS:
69+
#### PROPS:
6270

6371
| Name | Description | Type | Default | Options |
6472
| ----------- | --------------- | ------------ | ------------ | ------------ |
@@ -73,13 +81,12 @@ export default {
7381
| precision | Number of decimals | Number | 0 | Integer value|
7482
| controls | Enable/Disable Controls | Boolean | true | true/false|
7583
| controlsType | Controls Type | String | plusminus | plusminus/updown|
76-
| autofocus | Set Autofocus | Boolean | false | true/false|
84+
| autofocus | Autofocus on Page Load | Boolean | false | true/false|
7785
| readonly | Is Readonly | Boolean | false | true/false|
7886
| disabled | Is Disabled | Boolean | false | true/false|
7987

8088

81-
### EVENTS:
82-
89+
#### EVENTS:
8390

8491
Event Name | Description | Parameters
8592
-----------|--------------------|--------------
@@ -88,11 +95,16 @@ change | triggers when the value changes| (newValue)
8895
blur | triggers when Input blurs| (event: Event)
8996
focus | triggers when Input focus| (event: Event)
9097

91-
### METHODS:
9298

99+
#### METHODS:
93100

94101
Method | Description | Parameters
95102
---|--- | ----
96103
focus | focus the Input component| -
97104
blur | blur the Input component| -
98105

106+
Inspired by [react-numeric-input](https://github.com/vlad-ignatov/react-numeric-input)
107+
108+
## License
109+
110+
MIT

docs/static/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/manifest.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-numeric-input",
33
"version": "1.0.0",
4-
"description": "Vue Number Input Component",
4+
"description": "Vue Numeric Input Component",
55
"author": "JayeshLab <helloiamjayesh@gmail.com>",
66
"license": "MIT",
77
"repository": {

src/App.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,7 @@ export default {
281281
},
282282
data () {
283283
return {
284-
num: 10,
285-
num1: 22
286-
}
287-
},
288-
methods: {
289-
focusMethod () {
290-
this.$refs.numeric.focus()
284+
num: 10
291285
}
292286
}
293287
}

src/vue-numeric-input.vue

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,18 @@ export default {
268268
position: relative;
269269
display: inline-block;
270270
box-sizing: border-box;
271-
font-size: 16px;
271+
}
272+
.vue-numeric-input .numeric-input {
273+
padding-right: 1.8rem;
274+
padding-left: 1.8rem;
275+
box-sizing: border-box;
276+
font-size: inherit;
277+
border: 1px solid #cccccc;
278+
border-radius: 2px;
279+
display: block;
280+
line-height: 1.5rem;
281+
transition: all 0.1s ease 0s;
282+
width: 100%;
272283
}
273284
.vue-numeric-input .btn {
274285
position: absolute;
@@ -291,18 +302,6 @@ export default {
291302
box-shadow: none;
292303
cursor: not-allowed;
293304
}
294-
.vue-numeric-input .numeric-input {
295-
padding-right: 1.8rem;
296-
padding-left: 1.8rem;
297-
box-sizing: border-box;
298-
font-size: inherit;
299-
border: 1px solid #cccccc;
300-
border-radius: 2px;
301-
display: block;
302-
line-height: 1.5rem;
303-
transition: all 0.1s ease 0s;
304-
width: 100%;
305-
}
306305
.vue-numeric-input .numeric-input.no-control {
307306
padding: 2px 5px;
308307
}

0 commit comments

Comments
 (0)