rc-slider
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -60,6 +60,2 @@ 'use strict'; | ||
function isEmpty(collection) { | ||
return Object.keys(collection).length === 0; | ||
} | ||
var Slider = (function (_React$Component) { | ||
@@ -257,3 +253,3 @@ _inherits(Slider, _React$Component); | ||
var points = Object.keys(marks); | ||
if (isEmpty(marks) || step > 1) { | ||
if (step !== null) { | ||
for (var i = min; i <= max; i = i + step) { | ||
@@ -389,2 +385,3 @@ points.push(i); | ||
var range = _props5.range; | ||
var step = _props5.step; | ||
var marks = _props5.marks; | ||
@@ -397,4 +394,2 @@ var max = _props5.max; | ||
var marksCount = Object.keys(marks).length; | ||
var sliderClassName = (0, _rcUtil.classSet)((_classSet = {}, _defineProperty(_classSet, prefixCls, true), _defineProperty(_classSet, prefixCls + '-disabled', disabled), _defineProperty(_classSet, className, !!className), _classSet)); | ||
@@ -412,3 +407,3 @@ | ||
var handleClassName = prefixCls + '-handle'; | ||
var isNoTip = marksCount > 0 && !tipFormatter; | ||
var isNoTip = step === null && !tipFormatter; | ||
var upper = _react2['default'].createElement(_Handle2['default'], { className: handleClassName, tipTransitionName: tipTransitionName, noTip: isNoTip, tipFormatter: tipFormatter, | ||
@@ -415,0 +410,0 @@ offset: upperOffset, value: upperBound, dragging: handle === 'upperBound' }); |
{ | ||
"name": "rc-slider", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "slider ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -92,6 +92,12 @@ # rc-slider | ||
<tr> | ||
<td>marks</td> | ||
<td>object {number: string}</td> | ||
<td>{}</td> | ||
<td>Mark on the slider. The key determines the position, and the value determines what will show.</td> | ||
</tr> | ||
<tr> | ||
<td>step</td> | ||
<td>number</td> | ||
<td>number or `null`</td> | ||
<td>1</td> | ||
<td>Value to be added or subtracted on each step the slider makes. Must be greater than zero. max - min should be evenly divisible by the step value.</td> | ||
<td>Value to be added or subtracted on each step the slider makes. Must be greater than zero. max - min should be evenly divisible by the step value. When `marks` is not an empty object, `step` can be set to `null`, to make marks as steps.</td> | ||
</tr> | ||
@@ -117,8 +123,2 @@ <tr> | ||
<tr> | ||
<td>marks</td> | ||
<td>array</td> | ||
<td>[]</td> | ||
<td>Mark every step for the slider, it will ignore the `step` parameter if it has been defined. Does not work with `range`</td> | ||
</tr> | ||
<tr> | ||
<td>included</td> | ||
@@ -130,18 +130,6 @@ <td>boolean</td> | ||
<tr> | ||
<td>defaultIndex</td> | ||
<td>number</td> | ||
<td>0</td> | ||
<td>For step or marks slider, determines the initial position of the handle. Does not work with `range`</td> | ||
</tr> | ||
<tr> | ||
<td>index</td> | ||
<td>number</td> | ||
<td></td> | ||
<td>For step or marks slider, determines current position of the handle. Does not work with `range`</td> | ||
</tr> | ||
<tr> | ||
<td>disabled</td> | ||
<td>boolean</td> | ||
<td>false</td> | ||
<td>If true the handles can't be moved.</td> | ||
<td>If `true`, handles can't be moved.</td> | ||
</tr> | ||
@@ -156,3 +144,3 @@ <tr> | ||
<td>tipFormatter</td> | ||
<td>func</td> | ||
<td>function</td> | ||
<td></td> | ||
@@ -165,3 +153,3 @@ <td>Format the value of the tooltip if it shows.</td> | ||
<td>false</td> | ||
<td>For linear slider, when the `step` value is greater than 1, you can set the `dots` to `true` if you want to render the slider bar with dots.</td> | ||
<td>When the `step` value is greater than 1, you can set the `dots` to `true` if you want to render the slider with dots.</td> | ||
</tr> | ||
@@ -168,0 +156,0 @@ </tbody> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38196
851
178