mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
deps: replace rcUtil.classSet with classNames
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
"lint"
|
||||
],
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.1",
|
||||
"rc-tooltip": "3.x",
|
||||
"rc-util": "3.x"
|
||||
}
|
||||
|
||||
+2
-2
@@ -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,
|
||||
});
|
||||
|
||||
+2
-2
@@ -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,
|
||||
});
|
||||
|
||||
+3
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user