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-10-24 12:04:26 +08:00
|
|
|
const { prefixCls = 'ant-input-group', className = '' } = props;
|
|
|
|
const cls = classNames({
|
|
|
|
[prefixCls]: true,
|
2016-09-14 16:18:33 +08:00
|
|
|
[`${props.prefixCls}-lg`]: props.size === 'large',
|
|
|
|
[`${props.prefixCls}-sm`]: props.size === 'small',
|
2016-10-24 12:04:26 +08:00
|
|
|
[className]: !!className,
|
2016-04-13 17:38:53 +08:00
|
|
|
});
|
|
|
|
return (
|
2016-10-24 12:04:26 +08:00
|
|
|
<span className={cls} style={props.style}>
|
2016-04-13 17:38:53 +08:00
|
|
|
{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
|
|
|
|
|
|
|
export default Group;
|