-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() {
}
});
}
if (open !== undefined) {
- this.setState({open});
+ this.setState({ open });
}
},
},
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 (
<Panel
prefixCls={`${prefixCls}-panel`}
},
setOpen(open, callback) {
- const {onOpen, onClose} = this.props;
+ const { onOpen, onClose } = this.props;
if (this.state.open !== open) {
this.setState({
open,
onPopupVisibleChange={this.onVisibleChange}
>
<span className={`${prefixCls} ${className}`} style={style}>
- <input className={`${prefixCls}-input`}
- ref="picker" type="text" placeholder={placeholder}
- readOnly
- onKeyDown={this.onKeyDown}
- disabled={disabled} value={value && this.getFormatter().format(value)}/>
+ <input
+ className={`${prefixCls}-input`}
+ ref="picker" type="text" placeholder={placeholder}
+ readOnly
+ onKeyDown={this.onKeyDown}
+ disabled={disabled} value={value && this.getFormatter().format(value) || ''}
+ />
<span className={`${prefixCls}-icon`}/>
</span>
</Trigger>
-import React, {PropTypes} from 'react';
+import React, { PropTypes } from 'react';
import createSelection from '../util/selection';
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;
},
onClear() {
- this.setState({str: ''});
+ this.setState({ str: '' });
this.props.onClear();
},
const { prefixCls, placeholder } = this.props;
const { invalid, str } = this.state;
const invalidClass = invalid ? `${prefixCls}-input-invalid` : '';
- return (<input className={`${prefixCls}-input ${invalidClass}`}
- ref="input"
- onKeyDown={this.onKeyDown}
- value={str}
- placeholder={placeholder} onChange={this.onInputChange}/>);
+ return (<input
+ className={`${prefixCls}-input ${invalidClass}`}
+ ref="input"
+ onKeyDown={this.onKeyDown}
+ value={str}
+ placeholder={placeholder} onChange={this.onInputChange}
+ />);
},
selectRange() {