Skip to content

Commit ed57103

Browse files
committed
release v2.5.0
1 parent 3b00e6b commit ed57103

31 files changed

+345
-229
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-widgets",
3-
"version": "2.4.1",
3+
"version": "2.5.0",
44
"main": "dist/react-widgets.js",
55
"description": "A set of input widgets for React",
66
"homepage": "http://jquense.github.io/react-widgets/docs",

dist/css/react-widgets.css

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,25 @@ input.rw-input::-moz-focus-inner {
7272
-moz-osx-font-smoothing: grayscale;
7373
}
7474
.rw-i-caret-down:before {
75-
content: '\e801';
75+
content: '\e803';
7676
}
7777
.rw-i-caret-up:before {
7878
content: '\e800';
7979
}
8080
.rw-i-caret-left:before {
81-
content: '\e807';
81+
content: '\e801';
8282
}
8383
.rw-i-caret-right:before {
84-
content: '\e806';
84+
content: '\e802';
8585
}
8686
.rw-i-clock-o:before {
87-
content: '\e80c';
87+
content: '\e805';
8888
}
8989
.rw-i-calendar:before {
90-
content: '\e808';
90+
content: '\e804';
91+
}
92+
.rw-i-search:before {
93+
content: '\e806';
9194
}
9295
/* for debugging */
9396
.rw-widget {
@@ -129,6 +132,26 @@ input.rw-input::-moz-focus-inner {
129132
.rw-input[readonly] {
130133
cursor: not-allowed;
131134
}
135+
.rw-filter-input {
136+
position: relative;
137+
width: 100%;
138+
padding-right: 1.9em;
139+
border: #cccccc 1px solid;
140+
border-radius: 4px;
141+
margin-bottom: 2px;
142+
}
143+
.rw-rtl .rw-filter-input {
144+
padding-left: 1.9em;
145+
padding-right: 0;
146+
}
147+
.rw-filter-input > .rw-input {
148+
width: 100%;
149+
border: none;
150+
outline: none;
151+
}
152+
.rw-filter-input > span {
153+
margin-top: -2px;
154+
}
132155
.rw-i.rw-loading {
133156
background: url("../img/loading.gif") no-repeat center;
134157
width: 16px;
@@ -342,6 +365,9 @@ ul.rw-list.rw-list-grouped > li.rw-list-option,
342365
.rw-dropdownlist > .rw-input::-webkit-input-placeholder {
343366
color: #999999;
344367
}
368+
.rw-placeholder {
369+
color: #999999;
370+
}
345371
.rw-select {
346372
position: absolute;
347373
width: 1.9em;
@@ -397,9 +423,16 @@ ul.rw-list.rw-list-grouped > li.rw-list-option,
397423
padding-right: 0;
398424
overflow: hidden;
399425
text-overflow: ellipsis;
426+
white-space: nowrap;
427+
}
428+
.rw-dropdownlist.rw-rtl > .rw-input {
429+
padding: 0.429em 0.857em;
430+
padding-top: 0;
431+
padding-bottom: 0;
432+
padding-left: 0;
400433
}
401434
.rw-dropdownlist > .rw-select,
402-
.rw-dropdownlist > .rw-select.rw-rtl {
435+
.rw-dropdownlist.rw-rtl > .rw-select {
403436
border-width: 0;
404437
}
405438
.rw-numberpicker .rw-btn {

dist/fonts/rw-widgets.eot

140 Bytes
Binary file not shown.

dist/fonts/rw-widgets.svg

Lines changed: 8 additions & 7 deletions
Loading

dist/fonts/rw-widgets.ttf

140 Bytes
Binary file not shown.

dist/fonts/rw-widgets.woff

128 Bytes
Binary file not shown.

dist/react-widgets.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Combobox.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ var propTypes = {
2626
listComponent: CustomPropTypes.elementType,
2727

2828
groupComponent: CustomPropTypes.elementType,
29-
groupBy: React.PropTypes.oneOfType([React.PropTypes.func, React.PropTypes.string]),
29+
groupBy: CustomPropTypes.accessor,
3030

3131
data: React.PropTypes.array,
3232
valueField: React.PropTypes.string,
33-
textField: React.PropTypes.string,
33+
textField: CustomPropTypes.accessor,
3434
name: React.PropTypes.string,
3535

3636
onSelect: React.PropTypes.func,
@@ -141,8 +141,8 @@ var ComboBox = React.createClass({
141141
babelHelpers._extends({}, props, {
142142
ref: "element",
143143
role: "combobox",
144-
onKeyDown: this._maybeHandle(this._keyDown),
145-
onFocus: this._maybeHandle(this._focus.bind(null, true), true),
144+
onKeyDown: this._keyDown,
145+
onFocus: this._focus.bind(null, true),
146146
onBlur: this._focus.bind(null, false),
147147
tabIndex: "-1",
148148
className: cx(className, "rw-combobox", "rw-widget", (function () {
@@ -159,7 +159,7 @@ var ComboBox = React.createClass({
159159
{
160160
tabIndex: "-1",
161161
className: "rw-select",
162-
onClick: this._maybeHandle(this.toggle),
162+
onClick: this.toggle,
163163
disabled: !!(this.props.disabled || this.props.readOnly) },
164164
React.createElement(
165165
"i",
@@ -208,7 +208,7 @@ var ComboBox = React.createClass({
208208
data: items,
209209
selected: this.state.selectedItem,
210210
focused: this.state.focusedItem,
211-
onSelect: this._maybeHandle(this._onSelect),
211+
onSelect: this._onSelect,
212212
onMove: this._scrollTo,
213213
messages: {
214214
emptyList: this.props.data.length ? this.props.messages.emptyFilter : this.props.messages.emptyList
@@ -218,12 +218,12 @@ var ComboBox = React.createClass({
218218
);
219219
},
220220

221-
_onSelect: function (data) {
221+
_onSelect: _.ifNotDisabled(function (data) {
222222
this.close();
223223
this.notify("onSelect", data);
224224
this.change(data);
225225
this._focus(true);
226-
},
226+
}),
227227

228228
_inputKeyDown: function (e) {
229229
this._deleting = e.key === "Backspace" || e.key === "Delete";
@@ -252,7 +252,7 @@ var ComboBox = React.createClass({
252252
this.open();
253253
},
254254

255-
_focus: function (focused, e) {
255+
_focus: _.ifNotDisabled(true, function (focused, e) {
256256
var _this = this;
257257

258258
clearTimeout(this.timer);
@@ -266,9 +266,9 @@ var ComboBox = React.createClass({
266266
_this.setState({ focused: focused });
267267
}
268268
}, 0);
269-
},
269+
}),
270270

271-
_keyDown: function (e) {
271+
_keyDown: _.ifNotDisabled(function (e) {
272272
var self = this,
273273
key = e.key,
274274
alt = e.altKey,
@@ -301,7 +301,7 @@ var ComboBox = React.createClass({
301301

302302
self.change(item, false);
303303
}
304-
},
304+
}),
305305

306306
change: function (data, typing) {
307307
this._typedChange = !!typing;
@@ -316,11 +316,11 @@ var ComboBox = React.createClass({
316316
if (this.props.open) this.notify("onToggle", false);
317317
},
318318

319-
toggle: function (e) {
319+
toggle: _.ifNotDisabled(function (e) {
320320
this._focus(true);
321321

322322
this.props.open ? this.close() : this.open();
323-
},
323+
}),
324324

325325
suggest: function (data, value) {
326326
var word = this._dataText(value),

lib/DateTimePicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ var DateTimePicker = React.createClass({
292292
},
293293

294294
focus: function () {
295-
if (activeElement() !== this.refs.valueInput.getDOMNode()) this.refs.valueInput.focus();
295+
if (activeElement() !== compat.findDOMNode(this.refs.valueInput)) this.refs.valueInput.focus();
296296
},
297297

298298
_selectDate: function (date) {

0 commit comments

Comments
 (0)