|
@ -25,13 +25,12 @@ Group.defaultProps = { |
|
|
className: 'ant-input-group', |
|
|
className: 'ant-input-group', |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Input extends React.Component { |
|
|
class Input extends React.Component { |
|
|
// TODO |
|
|
|
|
|
getInputDOMNode() { |
|
|
getInputDOMNode() { |
|
|
return this.refs.input; |
|
|
return this.refs.input; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// TODO |
|
|
|
|
|
getValue() { |
|
|
getValue() { |
|
|
if (this.props.type === 'static') { |
|
|
if (this.props.type === 'static') { |
|
|
return this.props.value; |
|
|
return this.props.value; |
|
@ -70,17 +69,16 @@ class Input extends React.Component { |
|
|
renderInput() { |
|
|
renderInput() { |
|
|
const props = this.props; |
|
|
const props = this.props; |
|
|
const prefixCls = props.prefixCls; |
|
|
const prefixCls = props.prefixCls; |
|
|
const inputClassName = prefixClsFn(prefixCls, 'input'); |
|
|
let inputClassName = prefixClsFn(prefixCls, 'input'); |
|
|
if (!props.type) { |
|
|
if (!props.type) { |
|
|
return props.children; |
|
|
return props.children; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// let inputClass; |
|
|
switch (props.size) { |
|
|
// switch (props.size) { |
|
|
case 'small': inputClassName = prefixClsFn(prefixCls, 'input', 'input-sm'); break; |
|
|
// case 'small': inputClass = prefixClsFn(inputClassName, 'sm'); break; |
|
|
case 'large': inputClassName = prefixClsFn(prefixCls, 'input', 'input-lg'); break; |
|
|
// case 'large': inputClass = prefixClsFn(inputClassName, 'lg'); break; |
|
|
default: |
|
|
// default: |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
switch (props.type) { |
|
|
switch (props.type) { |
|
|
case 'textarea': |
|
|
case 'textarea': |
|
@ -92,6 +90,7 @@ class Input extends React.Component { |
|
|
</p> |
|
|
</p> |
|
|
); |
|
|
); |
|
|
default: |
|
|
default: |
|
|
|
|
|
inputClassName = props.className ? props.className : inputClassName; |
|
|
return <input {...props} className={inputClassName} ref="input" key="input"/>; |
|
|
return <input {...props} className={inputClassName} ref="input" key="input"/>; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -107,7 +106,7 @@ Input.propTypes = { |
|
|
React.PropTypes.string, |
|
|
React.PropTypes.string, |
|
|
React.PropTypes.number, |
|
|
React.PropTypes.number, |
|
|
]), |
|
|
]), |
|
|
size: React.PropTypes.oneOf(['small', 'medium', 'large']), |
|
|
size: React.PropTypes.oneOf(['small', 'default', 'large']), |
|
|
disabled: React.PropTypes.bool, |
|
|
disabled: React.PropTypes.bool, |
|
|
value: React.PropTypes.any, |
|
|
value: React.PropTypes.any, |
|
|
defaultValue: React.PropTypes.any, |
|
|
defaultValue: React.PropTypes.any, |
|
|