Skip to content

Commit 82522d9

Browse files
committed
release v2.6.0
1 parent 030c94b commit 82522d9

18 files changed

Lines changed: 133 additions & 72 deletions

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.5.2",
3+
"version": "2.6.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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ input.rw-input::-moz-focus-inner {
120120
height: 2.286em;
121121
line-height: 2.286em;
122122
padding: 0.429em 0.857em;
123+
background-color: #ffffff;
123124
}
124125
.rw-input[disabled] {
125126
-webkit-box-shadow: none;

dist/react-widgets.js

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

docs/public/docs.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/public/docs.js

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

lib/Combobox.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ var ComboBox = React.createClass({
9191
};
9292
},
9393

94-
componentDidMount: function () {
95-
validateList(this.refs.list);
94+
componentDidUpdate: function () {
95+
this.refs.list && validateList(this.refs.list);
9696
},
9797

9898
shouldComponentUpdate: function (nextProps, nextState) {
@@ -133,6 +133,7 @@ var ComboBox = React.createClass({
133133
var listID = this._id("_listbox");
134134
var optID = this._id("_option");
135135
var dropUp = this.props.dropUp;
136+
var renderList = _.isFirstFocusedRender(this) || this.props.open;
136137
var List = this.props.listComponent || this.props.groupBy && GroupableList || PlainList;
137138
var completeType = this.props.suggest ? this.props.filter ? "both" : "inline" : this.props.filter ? "list" : "";
138139

@@ -199,7 +200,7 @@ var ComboBox = React.createClass({
199200
React.createElement(
200201
"div",
201202
null,
202-
React.createElement(List, babelHelpers._extends({ ref: "list"
203+
renderList && React.createElement(List, babelHelpers._extends({ ref: "list"
203204
}, _.pick(this.props, Object.keys(compat.type(List).propTypes)), {
204205
id: listID,
205206
optID: optID,

lib/ComboboxInput.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ var React = require("react"),
55
compat = require("./util/compat");
66

77
module.exports = React.createClass({
8-
displayName: "exports",
8+
9+
displayName: "ComboboxInput",
910

1011
propTypes: {
1112
value: React.PropTypes.string,

lib/DateTimePicker.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ var DateTimePicker = React.createClass({
114114
var timeOptID = this._id("_time_option");
115115
var dateListID = this._id("_cal");
116116
var dropUp = this.props.dropUp;
117+
var renderPopup = _.isFirstFocusedRender(this) || this.props.open;
117118
var value = dateOrNull(this.props.value);
118119
var owns;
119120

@@ -211,7 +212,7 @@ var DateTimePicker = React.createClass({
211212
React.createElement(
212213
"div",
213214
null,
214-
React.createElement(Time, { ref: "timePopup",
215+
renderPopup && React.createElement(Time, { ref: "timePopup",
215216
id: timeListID,
216217
optID: timeOptID,
217218
"aria-hidden": !this.props.open,
@@ -234,7 +235,7 @@ var DateTimePicker = React.createClass({
234235
open: this.props.open === popups.CALENDAR,
235236
duration: this.props.duration,
236237
onRequestClose: this.close },
237-
React.createElement(Calendar, babelHelpers._extends({}, calProps, {
238+
renderPopup && React.createElement(Calendar, babelHelpers._extends({}, calProps, {
238239
ref: "calPopup",
239240
tabIndex: "-1",
240241
id: dateListID,
@@ -324,15 +325,19 @@ var DateTimePicker = React.createClass({
324325

325326
_parse: function (string) {
326327
var format = getFormat(this.props, true),
328+
editFormat = this.props.editFormat,
329+
parse = this.props.parse,
327330
formats = [];
328331

329-
if (typeof this.props.parse === "function") return this.props.parse(string, this.props.culture);
332+
if (typeof parse === "function") return parse(string, this.props.culture);
330333

331-
if (typeof format !== "function") formats.push(format);
334+
if (typeof format === "string") formats.push(format);
332335

333-
if (this.props.parse) formats = formats.concat(this.props.parse);
336+
if (typeof editFormat === "string") formats.push(editFormat);
334337

335-
invariant(formats.length, "React Widgets: there are no specified `parse` formats provided and the `format` prop is a function. " + "the DateTimePicker is unable to parse `%s` into a dateTime, " + "please provide either a parse function or Globalize.js compatible string format", string);
338+
if (parse) formats = formats.concat(this.props.parse);
339+
340+
invariant(formats.length, "React Widgets: there are no specified `parse` formats provided and the `format` prop is a function. " + "the DateTimePicker is unable to parse `%s` into a dateTime, " + "please provide either a parse function or Globalize.js compatible string for `format`", string);
336341

337342
return formatsParser(formats, this.props.culture, string);
338343
},

lib/DropdownList.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ var DropdownList = React.createClass({
8787
focusedItem: data[initialIdx] || data[0] };
8888
},
8989

90-
componentDidMount: function () {
91-
validateList(this.refs.list);
90+
componentDidUpdate: function () {
91+
this.refs.list && validateList(this.refs.list);
9292
},
9393

9494
componentWillReceiveProps: function (props) {
@@ -115,6 +115,7 @@ var DropdownList = React.createClass({
115115
var valueItem = this._dataItem(data, this.props.value);
116116
var optID = this._id("_option");
117117
var dropUp = this.props.dropUp;
118+
var renderList = _.isFirstFocusedRender(this) || this.props.open;
118119
var List = this.props.listComponent || this.props.groupBy && GroupableList || PlainList;
119120

120121
return React.createElement(
@@ -175,7 +176,7 @@ var DropdownList = React.createClass({
175176
"div",
176177
null,
177178
this.props.filter && this._renderFilter(),
178-
React.createElement(List, babelHelpers._extends({ ref: "list"
179+
renderList && React.createElement(List, babelHelpers._extends({ ref: "list"
179180
}, _.pick(this.props, Object.keys(compat.type(List).propTypes)), {
180181
data: data,
181182
optID: optID,

lib/Month.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = React.createClass({
3636

3737
render: function () {
3838
var props = _.omit(this.props, ["max", "min", "value", "onChange"]),
39-
month = dates.visibleDays(this.props.value),
39+
month = dates.visibleDays(this.props.value, this.props.culture),
4040
rows = _.chunk(month, 7);
4141

4242
return React.createElement(

0 commit comments

Comments
 (0)