Skip to content

Commit ffdd062

Browse files
author
叶言
committed
fix: some diffs
- update to 3.6.0 (refs:react-component#85 (diff)) - change `.rc-slider-vertical` to `.{prefixClass}-vertical` (refs:react-component#85 (diff)) - put all the slider & Range in one row (refs:react-component#85 (diff))
1 parent 3b03957 commit ffdd062

File tree

7 files changed

+37
-36
lines changed

7 files changed

+37
-36
lines changed

HISTORY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# History
22
----
33

4-
## 3.5.2 / 2016-04-01
4+
## 3.6.0 / 2016-04-01
55

66
[#18](https://github.com/react-component/slider/issues/18) add `vertical` props ([@wnlee](https://github.com/WNLee))
77

assets/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
}
134134
}
135135

136-
.rc-slider-vertical {
136+
.@{prefixClass}-vertical {
137137
width: 4px;
138138
height: 100%;
139139
.@{prefixClass} {

examples/v-marks.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ const React = require('react');
44
const ReactDOM = require('react-dom');
55
const Slider = require('rc-slider');
66

7-
const style = {height: 400, marginBottom: 50, marginLeft: 50};
7+
const style = {float: 'left', 'marginBottom': 20, width: 160, height: 400, marginBottom: 160, marginLeft: 50};
8+
const parentStyle = {overflow: 'hidden'};
9+
810
const marks = {
911
'-10': '-10°C',
1012
0: <strong>0°C</strong>,
@@ -24,29 +26,29 @@ function log(value) {
2426
}
2527

2628
ReactDOM.render(
27-
<div>
28-
<p>Slider with marks, `step=null`</p>
29+
<div style={parentStyle}>
2930
<div style={style}>
31+
<p>Slider with marks, `step=null`</p>
3032
<Slider vertical min={-10} marks={marks} step={null} onChange={log} defaultValue={20} />
3133
</div>
32-
<p>Slider with marks and steps</p>
3334
<div style={style}>
35+
<p>Slider with marks and steps</p>
3436
<Slider vertical dots min={-10} marks={marks} step={10} onChange={log} defaultValue={20} />
3537
</div>
36-
<p>Slider with marks, `included=false`</p>
3738
<div style={style}>
39+
<p>Slider with marks, `included=false`</p>
3840
<Slider vertical min={-10} marks={marks} included={false} defaultValue={20} />
3941
</div>
40-
<p>Slider with marks and steps, `included=false`</p>
4142
<div style={style}>
43+
<p>Slider with marks and steps, `included=false`</p>
4244
<Slider vertical min={-10} marks={marks} step={10} included={false} defaultValue={20} />
4345
</div>
44-
<p>Range with marks</p>
4546
<div style={style}>
47+
<p>Range with marks</p>
4648
<Slider vertical min={-10} range marks={marks} onChange={log} defaultValue={[20, 40]} />
4749
</div>
48-
<p>Range with marks and steps</p>
4950
<div style={style}>
51+
<p>Range with marks and steps</p>
5052
<Slider vertical min={-10} range marks={marks} step={10} onChange={log} defaultValue={[20, 40]} />
5153
</div>
5254
</div>

examples/v-range.js

+11-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const React = require('react');
55
const ReactDOM = require('react-dom');
66
const Slider = require('rc-slider');
77

8-
const style = {height: 400, marginBottom: 50, marginLeft: 50};
8+
const style = {float: 'left', 'marginBottom': 20, width: 180, height: 400, marginBottom: 160, marginLeft: 50};
9+
const parentStyle = {overflow: 'hidden'};
910

1011
function log(value) {
1112
console.log(value);
@@ -38,15 +39,14 @@ const CustomizedRange = React.createClass({
3839
render: function() {
3940
return (
4041
<div style={style}>
42+
<Slider range vertical allowCross={false} value={this.state.value} onChange={this.onSliderChange} />
4143
<label>LowerBound: </label>
4244
<input type="number" value={this.state.lowerBound} onChange={this.onLowerBoundChange} />
4345
<br />
4446
<label>UpperBound: </label>
4547
<input type="number" value={this.state.upperBound} onChange={this.onUpperBoundChange} />
4648
<br />
4749
<button onClick={this.handleApply}>Apply</button>
48-
<br /><br />
49-
<Slider range vertical allowCross={false} value={this.state.value} onChange={this.onSliderChange} />
5050
</div>
5151
);
5252
},
@@ -75,42 +75,41 @@ const DynamicBounds = React.createClass({
7575
render: function() {
7676
return (
7777
<div style={style}>
78+
<Slider range vertical defaultValue={[20, 50]} min={this.state.min} max={this.state.max} onChange={this.onSliderChange} />
7879
<label>Min: </label>
7980
<input type="number" value={this.state.min} onChange={this.onMinChange} />
8081
<br />
8182
<label>Max: </label>
8283
<input type="number" value={this.state.max} onChange={this.onMaxChange} />
83-
<br /><br />
84-
<Slider range vertical defaultValue={[20, 50]} min={this.state.min} max={this.state.max} onChange={this.onSliderChange} />
8584
</div>
8685
);
8786
},
8887
});
8988

9089
ReactDOM.render(
91-
<div>
92-
<p>Basic Range,`allowCross=false`</p>
90+
<div style={parentStyle}>
9391
<div style={style}>
92+
<p>Basic Range,`allowCross=false`</p>
9493
<Slider range vertical allowCross={false} defaultValue={[0, 20]} onChange={log} />
9594
</div>
96-
<p>Basic Range,`step=20` </p>
9795
<div style={style}>
96+
<p>Basic Range,`step=20` </p>
9897
<Slider range vertical step={20} defaultValue={[20, 40]} onBeforeChange={log} />
9998
</div>
100-
<p>Basic Range,`step=20, dots` </p>
10199
<div style={style}>
100+
<p>Basic Range,`step=20, dots` </p>
102101
<Slider range vertical dots step={20} defaultValue={[20, 40]} onAfterChange={log} />
103102
</div>
104-
<p>Controlled Range</p>
105103
<div style={style}>
104+
<p>Controlled Range</p>
106105
<Slider range vertical value={[20, 40]} />
107106
</div>
108-
<p>Customized Range</p>
109107
<div style={style}>
108+
<p>Customized Range</p>
110109
<CustomizedRange />
111110
</div>
112-
<p>Range with dynamic `max` `min`</p>
113111
<div style={style}>
112+
<p>Range with dynamic `max` `min`</p>
114113
<DynamicBounds />
115114
</div>
116115
</div>

examples/v-slider.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const React = require('react');
55
const ReactDOM = require('react-dom');
66
const Slider = require('rc-slider');
77

8-
const style = {height: 400, marginBottom: 50, marginLeft: 50};
8+
const style = {float: 'left', 'marginBottom': 20, width: 200, height: 400, marginBottom: 160, marginLeft: 50};
9+
const parentStyle = {overflow: 'hidden'};
910

1011
function log(value) {
1112
console.log(value);
@@ -56,49 +57,48 @@ const DynamicBounds = React.createClass({
5657
render: function() {
5758
return (
5859
<div style={style}>
60+
<p>Slider with dynamic `min` `max`</p>
61+
<Slider vertical defaultValue={50} min={this.state.min} max={this.state.max} onChange={this.onSliderChange} />
5962
<label>Min: </label>
6063
<input type="number" value={this.state.min} onChange={this.onMinChange} />
6164
<br />
6265
<label>Max: </label>
6366
<input type="number" value={this.state.max} onChange={this.onMaxChange} />
64-
<br /><br />
65-
<Slider vertical defaultValue={50} min={this.state.min} max={this.state.max} onChange={this.onSliderChange} />
6667
</div>
6768
);
6869
},
6970
});
7071

7172
ReactDOM.render(
72-
<div>
73-
<p>Basic Slider</p>
73+
<div style={parentStyle}>
7474
<div style={style}>
75+
<p>Basic Slider</p>
7576
<Slider vertical tipTransitionName="rc-slider-tooltip-zoom-down" onChange={log} />
7677
</div>
77-
<p>Basic Slider,`step=20`</p>
7878
<div style={style}>
79+
<p>Basic Slider,`step=20`</p>
7980
<Slider vertical step={20} defaultValue={50} onBeforeChange={log} />
8081
</div>
81-
<p>Basic Slider,`step=20, dots`</p>
8282
<div style={style}>
83+
<p>Basic Slider,`step=20, dots`</p>
8384
<Slider vertical dots step={20} defaultValue={100} onAfterChange={log} />
8485
</div>
85-
<p>Basic Slider with `tipFormatter`</p>
8686
<div style={style}>
87+
<p>Basic Slider with `tipFormatter`</p>
8788
<Slider vertical tipFormatter={percentFormatter} tipTransitionName="rc-slider-tooltip-zoom-down" onChange={log} />
8889
</div>
89-
<p>Basic Slider without tooltip</p>
9090
<div style={style}>
91+
<p>Basic Slider without tooltip</p>
9192
<Slider vertical tipFormatter={null} onChange={log} />
9293
</div>
93-
<p>Controlled Slider</p>
9494
<div style={style}>
95+
<p>Controlled Slider</p>
9596
<Slider vertical value={50} />
9697
</div>
97-
<p>Customized Slider</p>
9898
<div style={style}>
99+
<p>Customized Slider</p>
99100
<CustomizedSlider />
100101
</div>
101-
<p>Slider with dynamic `min` `max`</p>
102102
<div>
103103
<DynamicBounds />
104104
</div>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-slider",
3-
"version": "3.5.2",
3+
"version": "3.6.0",
44
"description": "slider ui component for react",
55
"keywords": [
66
"react",

src/Slider.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class Slider extends React.Component {
357357
[prefixCls]: true,
358358
[prefixCls + '-disabled']: disabled,
359359
[className]: !!className,
360-
['rc-slider-vertical']: this.props.vertical,
360+
[prefixCls + '-vertical']: this.props.vertical,
361361
});
362362
const isIncluded = included || range;
363363
return (

0 commit comments

Comments
 (0)