vue-slider-component
Advanced tools
Comparing version 3.0.1-5 to 3.0.2
@@ -0,3 +1,16 @@ | ||
# CHANGELOG | ||
- remove dot-width and dot-height, dot-size support array type | ||
- remove event-type, use disabled | ||
## v3.0.2 | ||
> `2019-02-28` | ||
### đfeature | ||
- More customizable (`style`/`slot`) | ||
- Multiple style themes | ||
- Support for more sliders (Countless) | ||
- Add marks | ||
- Support SSR | ||
- Support Typescript | ||
### đBug Fixes | ||
- Fix v2.x exception. (No longer need to call refresh) |
@@ -1,6 +0,4 @@ | ||
import VueSlider from './vue-slider' | ||
import VueSliderDot from './vue-slider-dot' | ||
import VueSliderMark from './vue-slider-mark' | ||
import VueSlider, { ERROR_TYPE } from './vue-slider' | ||
export { VueSliderDot, VueSliderMark } | ||
export { ERROR_TYPE } | ||
export default VueSlider |
@@ -53,2 +53,3 @@ import VueSlider from '../vue-slider' | ||
pos: number | ||
index: number | ||
value: Value | ||
@@ -55,0 +56,0 @@ focus: boolean |
@@ -196,2 +196,7 @@ import Decimal from './decimal' | ||
getValueByIndex(index: number): Value { | ||
if (index < 0) { | ||
index = 0 | ||
} else if (index > this.total) { | ||
index = this.total | ||
} | ||
return this.data | ||
@@ -303,4 +308,4 @@ ? this.data[index] | ||
return this.dotsPos.map((_, i) => { | ||
const changeDot = changeDots.find(dot => dot.index === i) | ||
return changeDot ? changeDot.changePos : 0 | ||
const changeDot = changeDots.filter(dot => dot.index === i) | ||
return changeDot.length ? changeDot[0].changePos : 0 | ||
}) | ||
@@ -355,2 +360,6 @@ } | ||
} | ||
if (typeof val !== 'number' || val !== val) { | ||
this.emitError(ERROR_TYPE.VALUE) | ||
return 0 | ||
} | ||
val = new Decimal(val) | ||
@@ -362,7 +371,2 @@ .minus(this.min) | ||
if (typeof val !== 'number') { | ||
this.emitError(ERROR_TYPE.VALUE) | ||
return 0 | ||
} | ||
const pos = new Decimal(val).multiply(this.gap).toNumber() | ||
@@ -369,0 +373,0 @@ return pos < 0 ? 0 : pos > 100 ? 100 : pos |
@@ -18,5 +18,6 @@ import { Direction } from '../typings' | ||
const event = e instanceof MouseEvent ? e : e.targetTouches[0] | ||
const rect = elem.getBoundingClientRect() | ||
const posObj = { | ||
x: event.pageX - elem.offsetLeft, | ||
y: event.pageY - elem.offsetTop, | ||
x: event.pageX - rect.left, | ||
y: event.pageY - rect.top, | ||
} | ||
@@ -23,0 +24,0 @@ return { |
{ | ||
"name": "vue-slider-component", | ||
"version": "3.0.1-5", | ||
"description": "Can use the Slider component in vue1.x and vue2.x", | ||
"version": "3.0.2", | ||
"description": "A highly customized slider component", | ||
"keywords": [ | ||
@@ -14,2 +14,9 @@ "vue", | ||
"typings": "./typings/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"lib", | ||
"src", | ||
"typings", | ||
"theme" | ||
], | ||
"repository": { | ||
@@ -24,3 +31,3 @@ "type": "git", | ||
}, | ||
"homepage": "https://github.com/NightCatSama/vue-slider-component#readme", | ||
"homepage": "https://github.com/NightCatSama/vue-slider-component", | ||
"scripts": { | ||
@@ -30,7 +37,8 @@ "serve": "vue-cli-service serve", | ||
"build:library": "npm run package && npm run sass", | ||
"package": "vue-cli-service build --target lib --name vue-slider-component lib/index.ts", | ||
"package": "vue-cli-service build --mode package --target lib --name vue-slider-component lib/index.ts", | ||
"sass": "sass lib/theme:theme", | ||
"prettier": "prettier --write lib/**/*.{ts,tsx,scss}", | ||
"lint": "vue-cli-service lint", | ||
"test:unit": "vue-cli-service test:unit" | ||
"test:unit": "vue-cli-service test:unit", | ||
"deploy:docs": "sh scripts/deploy.sh" | ||
}, | ||
@@ -47,3 +55,2 @@ "gitHooks": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -61,2 +68,3 @@ "@commitlint/config-conventional": "^7.3.1", | ||
"lint-staged": "^8.1.0", | ||
"markdown-it-container": "^2.0.0", | ||
"node-sass": "^4.9.0", | ||
@@ -69,5 +77,9 @@ "prettier": "^1.15.2", | ||
"vue-class-component": "^6.0.0", | ||
"vue-markdown-loader": "^2.4.1", | ||
"vue-property-decorator": "^7.0.0", | ||
"vue-template-compiler": "^2.6.6" | ||
"vue-router": "^3.0.2", | ||
"vue-template-compiler": "^2.6.6", | ||
"codemirror": "^5.44.0", | ||
"vuep": "^0.8.1" | ||
} | ||
} |
@@ -8,16 +8,10 @@ | ||
> đ a highly customized slider component | ||
> đ A highly customized slider component | ||
English | [įŽäŊä¸æ](https://github.com/NightCatSama/vue-slider-component/blob/master/README-CN.md) | ||
English | [įŽäŊä¸æ](https://github.com/NightCatSama/vue-slider-component/blob/refactor/README-CN.md) | ||
## đ´ Todo | ||
- [x] Basis | ||
- [ ] Update guide | ||
- [ ] Document | ||
- [ ] Test | ||
## ⨠New Features (v3.x) | ||
- đ¤Ŗ Fix [exceptions](https://github.com/NightCatSama/vue-slider-component#exceptions) | ||
- đ§ More customizable | ||
- đ§ Fix [exceptions](https://github.com/NightCatSama/vue-slider-component#exceptions) | ||
- đ More customizable | ||
- đ Multiple style themes | ||
@@ -27,8 +21,11 @@ - đŗ Support for more sliders | ||
- đ Support SSR | ||
- đ Support Typescript | ||
## đŊ install | ||
## đ¯ install | ||
```bash | ||
$ yarn add vue-slider-component@beta | ||
$ yarn add vue-slider-component | ||
``` | ||
## đ Usage | ||
@@ -55,2 +52,10 @@ ```vue | ||
</script> | ||
``` | ||
``` | ||
## Changelog | ||
Detailed changes for each release are documented in the [release notes](https://github.com/NightCatSama/vue-slider-component/blob/master/CHANGELOG.md). | ||
## License | ||
[MIT](https://github.com/NightCatSama/vue-slider-component/blob/master/LICENSE) |
import Vue from 'vue' | ||
import App from './App.vue' | ||
import router from './router' | ||
import Vuep from 'vuep' | ||
import 'vuep/dist/vuep.css' | ||
import Example from './components/Example.vue' | ||
import VueSlider from '../lib' | ||
import { getTheme } from './utils' | ||
const theme = getTheme() | ||
switch (theme) { | ||
case 'antd': | ||
require('../lib/theme/antd.scss') | ||
break | ||
case 'material': | ||
require('../lib/theme/material.scss') | ||
break | ||
default: | ||
require('../lib/theme/default.scss') | ||
} | ||
Vue.use(Vuep) | ||
Vue.component('Example', Example) | ||
Vue.component('VueSlider', VueSlider) | ||
Vue.config.productionTip = false | ||
@@ -8,2 +35,3 @@ | ||
render: h => h(App), | ||
router, | ||
}).$mount('#app') |
@@ -1,8 +0,6 @@ | ||
import VueSlider from '../lib/vue-slider' | ||
import VueSliderDot from '../lib/vue-slider-dot' | ||
import VueSliderMark from '../lib/vue-slider-mark' | ||
import VueSlider, { ERROR_TYPE } from '../lib/vue-slider' | ||
declare module 'vue-slider-component' { | ||
export { VueSliderDot, VueSliderMark } | ||
export { ERROR_TYPE } | ||
export default VueSlider | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
97
17098
1
58
1279278
25