2016-09-21 11:54:53 +08:00
|
|
|
import React from 'react';
|
2016-03-31 17:46:35 +08:00
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2016-08-19 17:11:06 +08:00
|
|
|
export interface GroupProps {
|
|
|
|
className?: string;
|
2016-08-22 17:26:14 +08:00
|
|
|
size?: 'large' | 'small' | 'default';
|
2016-08-19 17:11:06 +08:00
|
|
|
children?: any;
|
|
|
|
style?: React.CSSProperties;
|
2016-09-14 16:18:33 +08:00
|
|
|
prefixCls?: string;
|
2016-08-19 17:11:06 +08:00
|
|
|
}
|
|
|
|
|
2016-08-22 17:26:14 +08:00
|
|
|
const Group: React.StatelessComponent<GroupProps> = (props) => {
|
2016-04-13 17:38:53 +08:00
|
|
|
const className = classNames({
|
2016-09-14 16:18:33 +08:00
|
|
|
[props.prefixCls]: true,
|
|
|
|
[`${props.prefixCls}-lg`]: props.size === 'large',
|
|
|
|
[`${props.prefixCls}-sm`]: props.size === 'small',
|
2016-04-13 17:38:53 +08:00
|
|
|
[props.className]: !!props.className,
|
|
|
|
});
|
|
|
|
return (
|
|
|
|
<span className={className} style={props.style}>
|
|
|
|
{props.children}
|
|
|
|
</span>
|
|
|
|
);
|
2016-08-22 17:26:14 +08:00
|
|
|
};
|
2016-04-13 17:38:53 +08:00
|
|
|
|
|
|
|
Group.propTypes = {
|
|
|
|
children: React.PropTypes.any,
|
|
|
|
};
|
2016-08-22 17:26:14 +08:00
|
|
|
|
2016-09-14 16:18:33 +08:00
|
|
|
Group.defaultProps = {
|
|
|
|
prefixCls: 'ant-input-group',
|
|
|
|
};
|
|
|
|
|
2016-08-22 17:26:14 +08:00
|
|
|
export default Group;
|