Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
levy committed Jul 5, 2019
2 parents 3237b5d + 3534168 commit 1b5ee19
Show file tree
Hide file tree
Showing 10 changed files with 1,390 additions and 62 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

15 changes: 15 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = api => {
return {
presets: [['@babel/env', {modules: api.env('test') ? 'commonjs' : false}]],
plugins: [
[
'@babel/transform-runtime',
{
regenerator: true,
// https://babeljs.io/docs/en/babel-plugin-transform-runtime#absoluteruntime
absoluteRuntime: true
}
]
]
}
}
10 changes: 10 additions & 0 deletions .github/badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
types:
feat: 'enhancement'
fix: 'bug'
docs: 'documentation'
refactor: 'refactor'
test: 'test'
perf: 'performance'
chore:
deps: 'dependencies'
default: 'chore'
10 changes: 9 additions & 1 deletion .grenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ module.exports = {
issue: '- {{name}} [{{text}}]({{url}})',
group: '\n### {{heading}}\n'
},
// https://github.com/nuxt/nuxt.js/releases
// https://gitmoji.carloscuesta.me
groupBy: {
'✨ New Features:': ['enhancement'],
'🐛 Bug Fixes:': ['bug']
'🐛 Bug Fixes:': ['bug'],
'📖 Documentation:': ['documentation'],
'💅 Refactors:': ['refactor'],
'♻️ Tests:': ['test'],
'🚀 Performance:': ['performance'],
'⚓ Dependency upgrades:': ['dependencies'],
'🏡 Chore:': ['chore']
}
}
95 changes: 95 additions & 0 deletions README-en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# el-number-range

[![](https://cdn.nlark.com/yuque/0/2019/svg/224563/1561960751889-d4d8cf71-81dd-4316-b470-96ec2f671707.svg#align=left&display=inline&height=20&originHeight=20&originWidth=90&size=0&status=done&width=90)](https://travis-ci.com/FEMessage/el-number-range)
[![](https://img.shields.io/npm/dm/@femessage/el-number-range.svg#align=left&display=inline&height=20&originHeight=20&originWidth=134&status=done&width=134)](https://www.npmjs.com/package/@femessage/el-number-range)
[![](https://img.shields.io/npm/v/@femessage/el-number-range.svg#align=left&display=inline&height=20&originHeight=20&originWidth=80&status=done&width=80)](https://www.npmjs.com/package/@femessage/el-number-range)
[![](https://img.shields.io/npm/l/@femessage/el-number-range.svg#align=left&display=inline&height=20&originHeight=20&originWidth=78&status=done&width=78)](https://github.com/FEMessage/el-number-range/blob/master/LICENSE)
[![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg#align=left&display=inline&height=20&originHeight=20&originWidth=90&status=done&width=90)](https://github.com/FEMessage/el-number-range/pulls)
![](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg#align=left&display=inline&height=20&originHeight=20&originWidth=104&status=done&width=104)

number range input component, first number should be not be bigger than the second.

![](https://cdn.nlark.com/yuque/0/2019/png/224563/1561960749041-53b1cf53-f39d-4353-a450-5ed0e59fb061.png#align=left&display=inline&height=298&originHeight=298&originWidth=1034&size=0&status=done&width=1034)

## Table of Contents

- [Introduction](#introduction)
- [Feature](#feature)
- [Demo](#demo)
- [Install](#install)
- [Example](#example)
- [Max](#max)
- [Min](#min)
- [License](#license)

## Introduction

The number range component is suitable for scenarios which needs set number range via two inputs, such as price range.

[⬆Back to Top](#table-of-contents)

## Feature

- Automatically range correction
- Support set min and max

[⬆Back to Top](#table-of-contents)

## Demo

- [Doc and online demo](https://femessage.github.io/el-number-range/)

[⬆Back to Top](#table-of-contents)

## Install

```html
# ensure installed element-ui and registered el-input-number
yarn add element-ui --save

# Step1 install
yarn add @femessage/el-number-range
```

```html
// Step2 In the required .vue file
<template>
<el-number-range v-model="range" />
</template>
<script>
import ElNumberRange from '@femessage/el-number-range'
export default {
components: {
ElNumberRange
},
data() {
return {
range: [0, 1000]
}
}
}
</script>
```

[⬆Back to Top](#table-of-contents)

## Example

### Max

![](https://cdn.nlark.com/yuque/0/2019/png/224563/1561960748788-c67bb853-ea3e-43b6-b7e7-839ca6c23868.png#align=left&display=inline&height=904&originHeight=904&originWidth=1758&size=0&status=done&width=1758)

### Min

![](https://cdn.nlark.com/yuque/0/2019/png/224563/1561960749222-35cf5922-a17b-422f-ad79-b60d459ded9f.png#align=left&display=inline&height=904&originHeight=904&originWidth=1758&size=0&status=done&width=1758)

[⬆Back to Top](#table-of-contents)

## Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

| [![](https://avatars0.githubusercontent.com/u/20603896?v=4#alt=linrunzheng&width=100)<br />**linrunzheng**](https://github.com/linrunzheng)<br />[💻](https://github.com/FEMessage/el-number-range/commits?author=linrunzheng) [📖](https://github.com/FEMessage/el-number-range/commits?author=linrunzheng) | [![](https://avatars3.githubusercontent.com/u/19513289?v=4#alt=EVILLT&width=100)<br />**EVILLT**](https://evila.me)<br />[🚇](#infra-evillt) | [![](https://avatars3.githubusercontent.com/u/19591950?v=4#alt=Donald%20Shen&width=100)<br />**Donald Shen**](https://donaldshen.github.io/portfolio)<br />[🐛](https://github.com/FEMessage/el-number-range/issues?q=author%3Adonaldshen) [📖](https://github.com/FEMessage/el-number-range/commits?author=donaldshen) | [![](https://avatars3.githubusercontent.com/u/9384365?v=4#alt=levy&width=100)<br />**levy**](https://github.com/levy9527/blog)<br />[🚇](#infra-levy9527) [👀](#review-levy9527) |
| --- | --- | --- | --- |


10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

![introduce](https://i.screenshot.net/8lw5osg)

[English](./README-en.md)

## Table of Contents <!-- omit in toc -->

* [Introduction](#introduction)
Expand All @@ -24,14 +26,14 @@

## Introduction

数字范围输入框,适用于需要输入范围的场景,比如价格,积分范围。通过对外暴露 input 事件,使用者可以通过 v-model 进行范围绑定,上手简单。
数字范围输入框,适用于需要输入范围的场景,比如价格,积分范围。

[⬆ Back to Top](#table-of-contents)

## Feature

* 自动进行范围纠正;
* 可自定义输入框范围 min - max;
* 自动进行范围纠正
* 可自定义输入框范围 min/max

[⬆ Back to Top](#table-of-contents)

Expand Down Expand Up @@ -66,7 +68,7 @@ export default {
},
data() {
return {
version: [0, 1000]
range: [0, 1000]
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"scripts": {
"dev": "vue-styleguidist server",
"test": "jest",
"doc": "vue-styleguidist build",
"build": "npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc",
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/el-number-range.umd.js",
Expand All @@ -44,6 +45,7 @@
"file-loader": "^3.0.1",
"glob": "^7.1.3",
"husky": "^0.14.3",
"jest": "^24.8.0",
"minimist": "^1.2.0",
"prettier": "1.12.1",
"pretty-quick": "^1.4.1",
Expand All @@ -65,7 +67,7 @@
"publishConfig": {
"access": "public"
},
"vue-sfc-cli": "1.10.0",
"vue-sfc-cli": "1.10.1",
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
Expand Down
5 changes: 5 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import sum from './sum'

test('main', () => {
expect(sum(1, 2)).toBe(3)
})
3 changes: 3 additions & 0 deletions test/sum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function sum(a, b) {
return a + b
}
Loading

0 comments on commit 1b5ee19

Please sign in to comment.