UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

27 lines (23 loc) 927 B
import _extends from "@babel/runtime/helpers/extends"; import _objectSpread from "@babel/runtime/helpers/objectSpread2"; import React, { forwardRef, memo, useContext } from 'react'; import Radio from './radio'; import RadioContext from './RadioContext'; var RadioButton = /*#__PURE__*/forwardRef(function (props, ref) { var _useContext = useContext(RadioContext), radioGroup = _useContext.radioGroup, getPrefixCls = _useContext.getPrefixCls; var radioProps = _objectSpread({}, props); if (radioGroup) { radioProps.checked = props.value === radioGroup.value; radioProps.disabled = props.disabled || radioGroup.disabled; } return /*#__PURE__*/React.createElement(Radio, _extends({ prefixCls: getPrefixCls('radio-button') }, radioProps, { ref: ref })); }); RadioButton.displayName = 'RadioButton'; export default /*#__PURE__*/memo(RadioButton); //# sourceMappingURL=radioButton.js.map