|
|
@ -3,10 +3,10 @@ import type { CheckboxRef } from 'rc-checkbox'; |
|
|
|
import RcCheckbox from 'rc-checkbox'; |
|
|
|
import { composeRef } from 'rc-util/lib/ref'; |
|
|
|
import * as React from 'react'; |
|
|
|
import warning from '../_util/warning'; |
|
|
|
import { ConfigContext } from '../config-provider'; |
|
|
|
import DisabledContext from '../config-provider/DisabledContext'; |
|
|
|
import { FormItemInputContext } from '../form/context'; |
|
|
|
import warning from '../_util/warning'; |
|
|
|
import RadioGroupContext, { RadioOptionTypeContext } from './context'; |
|
|
|
import type { RadioChangeEvent, RadioProps } from './interface'; |
|
|
|
|
|
|
@ -16,7 +16,7 @@ const InternalRadio: React.ForwardRefRenderFunction<CheckboxRef, RadioProps> = ( |
|
|
|
const groupContext = React.useContext(RadioGroupContext); |
|
|
|
const radioOptionTypeContext = React.useContext(RadioOptionTypeContext); |
|
|
|
|
|
|
|
const { getPrefixCls, direction } = React.useContext(ConfigContext); |
|
|
|
const { getPrefixCls, direction, radio } = React.useContext(ConfigContext); |
|
|
|
const innerRef = React.useRef<CheckboxRef>(null); |
|
|
|
const mergedRef = composeRef(ref, innerRef); |
|
|
|
const { isFormItemInput } = React.useContext(FormItemInputContext); |
|
|
@ -66,6 +66,7 @@ const InternalRadio: React.ForwardRefRenderFunction<CheckboxRef, RadioProps> = ( |
|
|
|
[`${prefixCls}-wrapper-rtl`]: direction === 'rtl', |
|
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput, |
|
|
|
}, |
|
|
|
radio?.className, |
|
|
|
className, |
|
|
|
rootClassName, |
|
|
|
hashId, |
|
|
@ -75,7 +76,7 @@ const InternalRadio: React.ForwardRefRenderFunction<CheckboxRef, RadioProps> = ( |
|
|
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
|
|
<label |
|
|
|
className={wrapperClassString} |
|
|
|
style={style} |
|
|
|
style={{ ...radio?.style, ...style }} |
|
|
|
onMouseEnter={props.onMouseEnter} |
|
|
|
onMouseLeave={props.onMouseLeave} |
|
|
|
> |
|
|
|