Skip to content

Commit b29beda

Browse files
committed
Merge pull request #1 from react-component/master
merge
2 parents 32d1593 + 7d7b742 commit b29beda

18 files changed

Lines changed: 367 additions & 203 deletions

HISTORY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# History
22
----
3+
4+
## 6.3.0 / 2016-04-28
5+
6+
- support onBlur
7+
8+
## 6.2.0 / 2016-04-20
9+
10+
- remove searchPlaceholder
11+
12+
## 6.1.0 / 2016-04-18
13+
14+
- go with http://semantic-ui.com/modules/dropdown.html#search-selection
15+
316
## 6.0.0 / 2016-03-16
417

518
- remove defaultLabel/label

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ React.render(c, container);
7575
|notFoundContent | specify content to show when no result matches. | String | 'Not Found' |
7676
|placeholder | select placeholder | React Node | |
7777
|showSearch | whether show search input in single mode | bool | true |
78-
|searchPlaceholder | search input placeholder | React Node | |
7978
|allowClear | whether allowClear | bool | false |
8079
|tags | when tagging is enabled the user can select from pre-existing options or create a new tag by picking the first choice, which is what the user has typed into the search box so far. | bool | false |
8180
|maxTagTextLength | max tag text length to show | number | - |

assets/index.less

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
position: relative;
1313
vertical-align: middle;
1414
color: #666;
15+
line-height: 28px;
16+
17+
&-allow-clear {
18+
.@{selectPrefixCls}-selection--single .@{selectPrefixCls}-selection__rendered {
19+
padding-right: 40px;
20+
}
21+
}
1522

1623
ul, li {
1724
margin: 0;
@@ -31,6 +38,7 @@
3138
top: 1px;
3239
right: 1px;
3340
width: 20px;
41+
outline: none;
3442
b {
3543
border-color: #999999 transparent transparent transparent;
3644
border-style: solid;
@@ -56,6 +64,12 @@
5664
background-color: #fff;
5765
border-radius: 6px;
5866
border: 1px solid #d9d9d9;
67+
68+
&__placeholder {
69+
position: absolute;
70+
top: 0;
71+
color: #aaa;
72+
}
5973
}
6074

6175
&-focused &-selection {
@@ -75,24 +89,34 @@
7589

7690
&-selection--single {
7791
height: 28px;
92+
line-height: 28px;
7893
cursor: pointer;
7994
position: relative;
8095

96+
.@{selectPrefixCls}-selection-selected-value {
97+
position: absolute;
98+
left: 0;
99+
top: 0;
100+
}
101+
81102
.@{selectPrefixCls}-selection__rendered {
103+
height: 28px;
104+
position: relative;
82105
display: block;
83106
overflow: hidden;
84107
white-space: nowrap;
85108
text-overflow: ellipsis;
86-
padding-left: 10px;
109+
margin-left: 10px;
87110
padding-right: 20px;
88111
line-height: 28px;
89112
}
90113

91114
.@{selectPrefixCls}-selection__clear {
92115
font-weight: bold;
93116
position: absolute;
94-
top: 5px;
117+
top: 0;
95118
right: 20px;
119+
line-height: 28px;
96120

97121
&:after {
98122
content: '×'
@@ -118,7 +142,6 @@
118142

119143
&-search__field__wrap {
120144
display: inline-block;
121-
position: relative;
122145
}
123146

124147
&-search__field__placeholder {
@@ -129,7 +152,6 @@
129152
}
130153

131154
&-search--inline {
132-
float: left;
133155
width: 100%;
134156
.@{selectPrefixCls}-search__field__wrap {
135157
width: 100%;
@@ -141,6 +163,9 @@
141163
background: transparent;
142164
outline: 0;
143165
width: 100%;
166+
&::-ms-clear {
167+
display: none;
168+
}
144169
}
145170
> i {
146171
float: right;
@@ -155,8 +180,12 @@
155180
min-height: 28px;
156181

157182
.@{selectPrefixCls}-search--inline {
183+
float: left;
158184
width: auto;
159185
.@{selectPrefixCls}-search__field {
186+
&__wrap {
187+
width: auto;
188+
}
160189
width: 0.75em;
161190
}
162191
}
@@ -167,17 +196,16 @@
167196
}
168197

169198
.@{selectPrefixCls}-selection__rendered {
170-
//display: inline-block;
199+
position: relative;
171200
overflow: hidden;
172201
text-overflow: ellipsis;
173-
padding-left: 8px;
202+
margin-left: 8px;
174203
padding-bottom: 2px;
175-
}
176204

177-
> ul > li {
178-
margin-top: 4px;
179-
height: 20px;
180-
line-height: 20px;
205+
.@{selectPrefixCls}-selection__choice {
206+
margin-top: 4px;
207+
line-height: 20px;
208+
}
181209
}
182210
}
183211

@@ -284,9 +312,6 @@
284312
z-index: 100;
285313
left: -9999px;
286314
top: -9999px;
287-
//border-top: none;
288-
//border-top-left-radius: 0;
289-
//border-top-right-radius: 0;
290315
position: absolute;
291316
outline: none;
292317

@@ -441,28 +466,6 @@
441466
}
442467
}
443468

444-
&-dropdown-search {
445-
display: block;
446-
padding: 4px;
447-
.@{selectPrefixCls}-search__field__wrap {
448-
width: 100%;
449-
}
450-
.@{selectPrefixCls}-search__field__placeholder {
451-
top: 4px;
452-
}
453-
.@{selectPrefixCls}-search__field {
454-
padding: 4px;
455-
width: 100%;
456-
box-sizing: border-box;
457-
border: 1px solid #d9d9d9;
458-
border-radius: 4px;
459-
outline: none;
460-
}
461-
&.@{selectPrefixCls}-search--hide {
462-
display: none;
463-
}
464-
}
465-
466469
&-open {
467470
.@{selectPrefixCls}-arrow b {
468471
border-color: transparent transparent #888 transparent;

examples/force-suggest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ const Search = React.createClass({
5555
value={this.state.value}
5656
optionLabelProp="children"
5757
placeholder="placeholder"
58-
searchPlaceholder="searchPlaceholder"
5958
style={{ width: 500 }}
6059
onChange={this.onChange}
6160
filterOption={false}

examples/getPopupContainer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const Test = React.createClass({
4343
<div style={{ marginTop: 20, position: 'relative' }}>
4444
<Select
4545
placeholder="placeholder"
46-
searchPlaceholder="searchPlaceholder"
4746
style={{ width: 200 }}
4847
getPopupContainer={this.getPopupContainer}
4948
>

examples/optgroup.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const c1 = (
1515
<div style={{ width: 300 }}>
1616
<Select
1717
placeholder="placeholder"
18-
searchPlaceholder="searchPlaceholder"
1918
defaultValue="lucy"
2019
showSearch={false}
2120
style={{ width: 500 }}

examples/optionFilterProp.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const c1 = (
1717
defaultValue="张三"
1818
style={{ width: 500 }}
1919
placeholder="placeholder"
20-
searchPlaceholder="searchPlaceholder"
2120
optionFilterProp="desc"
2221
onChange={onChange}
2322
>

examples/single-animation.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const c1 = (
1818
<Select
1919
allowClear
2020
placeholder="placeholder"
21-
searchPlaceholder="searchPlaceholder"
2221
defaultValue="lucy"
2322
style={{ width: 500 }}
2423
animation="slide-up"

examples/single.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const Test = React.createClass({
2020
} else {
2121
value = e;
2222
}
23+
console.log('onChange', value);
2324
this.setState({
2425
value,
2526
});
@@ -31,6 +32,10 @@ const Test = React.createClass({
3132
});
3233
},
3334

35+
onBlur(v) {
36+
console.log('onBlur', v);
37+
},
38+
3439
render() {
3540
if (this.state.destroy) {
3641
return null;
@@ -45,9 +50,9 @@ const Test = React.createClass({
4550
<Select
4651
value={this.state.value}
4752
placeholder="placeholder"
48-
searchPlaceholder="searchPlaceholder"
4953
dropdownMenuStyle={{ maxHeight: 200, overflow: 'auto' }}
5054
style={{ width: 500 }}
55+
onBlur={this.onBlur}
5156
allowClear
5257
optionLabelProp="children"
5358
optionFilterProp="text"

examples/suggest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const Search = React.createClass({
5656
combobox
5757
value={this.state.value}
5858
placeholder="placeholder"
59-
searchPlaceholder="searchPlaceholder"
6059
defaultActiveFirstOption={false}
6160
showArrow={false}
6261
notFoundContent=""

0 commit comments

Comments
 (0)