From 1882f74dd69a626f6f0592d94801c6968c038751 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Thu, 31 Mar 2016 17:36:34 +0800 Subject: [PATCH] fix 0.15 warning --- package.json | 2 +- src/TimePicker.jsx | 27 ++++++++++++++++----------- src/module/Header.jsx | 18 ++++++++++-------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 587c370..cb2896b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-time-picker", - "version": "1.1.3", + "version": "1.1.4", "description": "React TimePicker", "keywords": [ "react", diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index f9b9207..350eeb2 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -1,9 +1,9 @@ -import React, {PropTypes} from 'react'; +import React, { PropTypes } from 'react'; import Trigger from 'rc-trigger'; import Panel from './module/Panel'; import placements from './util/placements'; import CommonMixin from './mixin/CommonMixin'; -import {getFormatter} from './util/index'; +import { getFormatter } from './util/index'; function noop() { } @@ -80,7 +80,7 @@ const Picker = React.createClass({ }); } if (open !== undefined) { - this.setState({open}); + this.setState({ open }); } }, @@ -147,8 +147,11 @@ const Picker = React.createClass({ }, getPanelElement() { - const { prefixCls, defaultValue, locale, placeholder, disabledHours, - disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond } = this.props; + const { + prefixCls, defaultValue, locale, placeholder, disabledHours, + disabledMinutes, disabledSeconds, hideDisabledOptions, + allowEmpty, showHour, showSecond, + } = this.props; return ( - + diff --git a/src/module/Header.jsx b/src/module/Header.jsx index 33dec43..41099cc 100644 --- a/src/module/Header.jsx +++ b/src/module/Header.jsx @@ -1,4 +1,4 @@ -import React, {PropTypes} from 'react'; +import React, { PropTypes } from 'react'; import createSelection from '../util/selection'; const Header = React.createClass({ @@ -57,7 +57,7 @@ const Header = React.createClass({ str, }); let value = null; - const {formatter, gregorianCalendarLocale, hourOptions, minuteOptions, secondOptions, disabledHours, disabledMinutes, disabledSeconds, onChange, allowEmpty} = this.props; + const { formatter, gregorianCalendarLocale, hourOptions, minuteOptions, secondOptions, disabledHours, disabledMinutes, disabledSeconds, onChange, allowEmpty } = this.props; if (str) { const originalValue = this.props.value; @@ -144,7 +144,7 @@ const Header = React.createClass({ }, onClear() { - this.setState({str: ''}); + this.setState({ str: '' }); this.props.onClear(); }, @@ -160,11 +160,13 @@ const Header = React.createClass({ const { prefixCls, placeholder } = this.props; const { invalid, str } = this.state; const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; - return (); + return (); }, selectRange() { -- 2.41.0