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;
|
2017-01-02 00:12:41 +08:00
|
|
|
compact?: boolean;
|
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;
|
2016-11-30 10:20:23 +08:00
|
|
|
const cls = classNames(prefixCls, {
|
2016-10-28 14:25:09 +08:00
|
|
|
[`${prefixCls}-lg`]: props.size === 'large',
|
|
|
|
[`${prefixCls}-sm`]: props.size === 'small',
|
2017-01-02 00:12:41 +08:00
|
|
|
[`${prefixCls}-compact`]: props.compact,
|
2016-11-30 10:20:23 +08:00
|
|
|
}, 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
|
|
|
|
2016-08-22 17:26:14 +08:00
|
|
|
export default Group;
|