diff --git a/package.json b/package.json index 7365a6c..e4daf0c 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "lint" ], "dependencies": { + "classnames": "^2.2.1", "rc-tooltip": "3.x", "rc-util": "3.x" } diff --git a/src/Dots.jsx b/src/Dots.jsx index 2069295..305d317 100644 --- a/src/Dots.jsx +++ b/src/Dots.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { classSet } from 'rc-util'; +import classNames from 'classnames'; function calcPoints(marks, dots, step, min, max) { const points = Object.keys(marks).map(parseFloat); @@ -19,7 +19,7 @@ const Dots = ({prefixCls, marks, dots, step, included, lowerBound, upperBound, m const isActived = (!included && point === upperBound) || (included && point <= upperBound && point >= lowerBound); - const pointClassName = classSet({ + const pointClassName = classNames({ [prefixCls + '-dot']: true, [prefixCls + '-dot-active']: isActived, }); diff --git a/src/Marks.jsx b/src/Marks.jsx index 834e5bf..79cfff6 100644 --- a/src/Marks.jsx +++ b/src/Marks.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import rcUtil from 'rc-util'; +import classNames from 'classnames'; const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) => { const marksKeys = Object.keys(marks); @@ -11,7 +11,7 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) = const elements = marksKeys.map(parseFloat).map((point) => { const isActived = (!included && point === upperBound) || (included && point <= upperBound && point >= lowerBound); - const markClassName = rcUtil.classSet({ + const markClassName = classNames({ [className + '-text']: true, [className + '-text-active']: isActived, }); diff --git a/src/Slider.jsx b/src/Slider.jsx index e858937..5b6ed60 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -1,5 +1,6 @@ import React from 'react'; -import {Dom as DomUtils, classSet} from 'rc-util'; +import {Dom as DomUtils} from 'rc-util'; +import classNames from 'classnames'; import Track from './Track'; import Handle from './Handle'; import Dots from './Dots'; @@ -311,7 +312,7 @@ class Slider extends React.Component { offset={lowerOffset} value={lowerBound} dragging={handle === 'lowerBound'} />); } - const sliderClassName = classSet({ + const sliderClassName = classNames({ [prefixCls]: true, [prefixCls + '-disabled']: disabled, [className]: !!className,