mirror of
https://github.com/wassname/slider.git
synced 2026-09-11 12:42:49 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
926d5aeb91 | ||
|
|
b2ae1bc0fc | ||
|
|
80d4ee4794 | ||
|
|
e2504d99fe | ||
|
|
d4ae5a5298 |
+8
-8
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rc-slider",
|
"name": "rc-slider",
|
||||||
"version": "3.7.3",
|
"version": "3.8.0",
|
||||||
"description": "slider ui component for react",
|
"description": "slider ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
@@ -42,17 +42,17 @@
|
|||||||
"pre-commit": "1.x",
|
"pre-commit": "1.x",
|
||||||
"rc-server": "3.x",
|
"rc-server": "3.x",
|
||||||
"rc-tools": "4.x",
|
"rc-tools": "4.x",
|
||||||
"react": "~0.14.0",
|
"react": "^15.2.1",
|
||||||
"react-addons-test-utils": "^0.14.0",
|
"react-addons-test-utils": "^15.2.1",
|
||||||
"react-dom": "~0.14.0"
|
"react-dom": "^15.2.1"
|
||||||
},
|
},
|
||||||
"pre-commit": [
|
"pre-commit": [
|
||||||
"lint"
|
"lint"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.2.1",
|
"classnames": "^2.2.5",
|
||||||
"rc-tooltip": "3.x",
|
"rc-tooltip": "^3.4.2",
|
||||||
"rc-util": "3.x",
|
"rc-util": "^3.2.1",
|
||||||
"warning": "^2.1.0"
|
"warning": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-3
@@ -270,7 +270,7 @@ class Slider extends React.Component {
|
|||||||
|
|
||||||
const points = Object.keys(marks).map(parseFloat);
|
const points = Object.keys(marks).map(parseFloat);
|
||||||
if (step !== null) {
|
if (step !== null) {
|
||||||
const closestStep = Math.round(val / step) * step;
|
const closestStep = (Math.round((val - min) / step) * step) + min;
|
||||||
points.push(closestStep);
|
points.push(closestStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,15 +337,26 @@ class Slider extends React.Component {
|
|||||||
const lowerOffset = this.calcOffset(lowerBound);
|
const lowerOffset = this.calcOffset(lowerBound);
|
||||||
|
|
||||||
const handleClassName = prefixCls + '-handle';
|
const handleClassName = prefixCls + '-handle';
|
||||||
|
|
||||||
|
const upperClassName = classNames({
|
||||||
|
[handleClassName]: true,
|
||||||
|
[handleClassName + '-upper']: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const lowerClassName = classNames({
|
||||||
|
[handleClassName]: true,
|
||||||
|
[handleClassName + '-lower']: true,
|
||||||
|
});
|
||||||
|
|
||||||
const isNoTip = (step === null) || (tipFormatter === null);
|
const isNoTip = (step === null) || (tipFormatter === null);
|
||||||
|
|
||||||
const upper = cloneElement(customHandle, { className: handleClassName,
|
const upper = cloneElement(customHandle, { className: upperClassName,
|
||||||
noTip: isNoTip, tipTransitionName: tipTransitionName, tipFormatter: tipFormatter,
|
noTip: isNoTip, tipTransitionName: tipTransitionName, tipFormatter: tipFormatter,
|
||||||
vertical: vertical, offset: upperOffset, value: upperBound, dragging: handle === 'upperBound' });
|
vertical: vertical, offset: upperOffset, value: upperBound, dragging: handle === 'upperBound' });
|
||||||
|
|
||||||
let lower = null;
|
let lower = null;
|
||||||
if (range) {
|
if (range) {
|
||||||
lower = cloneElement(customHandle, { className: handleClassName,
|
lower = cloneElement(customHandle, { className: lowerClassName,
|
||||||
noTip: isNoTip, tipTransitionName: tipTransitionName, tipFormatter: tipFormatter,
|
noTip: isNoTip, tipTransitionName: tipTransitionName, tipFormatter: tipFormatter,
|
||||||
vertical: vertical, offset: lowerOffset, value: lowerBound, dragging: handle === 'lowerBound' });
|
vertical: vertical, offset: lowerOffset, value: lowerBound, dragging: handle === 'lowerBound' });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user