choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
29 lines (23 loc) • 834 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import React from 'react';
import PropTypes from 'prop-types';
import Radio from './radio';
import { getPrefixCls } from '../configure';
var RadioButton = function RadioButton(props, context) {
var radioGroup = context.radioGroup;
var radioProps = _objectSpread({}, props);
if (radioGroup) {
radioProps.checked = props.value === radioGroup.value;
radioProps.disabled = props.disabled || radioGroup.disabled;
}
return React.createElement(Radio, _extends({
prefixCls: getPrefixCls('radio-button')
}, radioProps));
};
RadioButton.displayName = 'RadioButton';
RadioButton.contextTypes = {
radioGroup: PropTypes.any
};
export default RadioButton;
//# sourceMappingURL=radioButton.js.map