rc-slider
Advanced tools
Comparing version 3.3.2 to 3.4.0
@@ -7,2 +7,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -35,3 +37,5 @@ | ||
var range = max - min; | ||
var elements = marksKeys.map(parseFloat).map(function (point) { | ||
var elements = marksKeys.map(parseFloat).sort(function (a, b) { | ||
return a - b; | ||
}).map(function (point) { | ||
var _classNames; | ||
@@ -45,6 +49,10 @@ | ||
var markPoint = marks[point]; | ||
var markPointIsObject = typeof markPoint === 'object'; | ||
var markLabel = markPointIsObject ? markPoint.label : markPoint; | ||
var markStyle = markPointIsObject ? _extends({}, style, markPoint.style) : style; | ||
return _react2['default'].createElement( | ||
'span', | ||
{ className: markClassName, style: style, key: point }, | ||
marks[point] | ||
{ className: markClassName, style: markStyle, key: point }, | ||
markLabel | ||
); | ||
@@ -51,0 +59,0 @@ }); |
{ | ||
"name": "rc-slider", | ||
"version": "3.3.2", | ||
"version": "3.4.0", | ||
"description": "slider ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -93,5 +93,5 @@ # rc-slider | ||
<td>marks</td> | ||
<td>object {number: string}</td> | ||
<td>object{number: string} or object{number: object{ style, label }}</td> | ||
<td>{}</td> | ||
<td>Mark on the slider. The key determines the position, and the value determines what will show.</td> | ||
<td>Mark on the slider. The key determines the position, and the value determines what will show. If you want to set the style of a specific mark point, the value should be an object which contains `style` and `label` properties.</td> | ||
</tr> | ||
@@ -98,0 +98,0 @@ <tr> |
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
42230
911