<wxs module="utils" src="../wxs/utils.wxs"/>
<wxs module="computed" src="./index.wxs"/>

<view class="{{ utils.bem('radio', [direction]) }} custom-class">
    <view
            bindtap="onClickLabel"
            class="{{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }} label-class"
            wx:if="{{ labelPosition === 'left' }}"
    >
        <slot/>
    </view>
    <view bindtap="onChange" class="van-radio__icon-wrap" style="font-size: {{ utils.addUnit(iconSize) }}">
        <slot name="icon" wx:if="{{ useIconSlot }}"/>
        <van-icon
                class="{{ utils.bem('radio__icon', [shape, { disabled: disabled || parentDisabled, checked: value === name }]) }}"
                custom-class="icon-class"
                custom-style="{{ computed.iconCustomStyle({ iconSize }) }}"
                name="success"
                style="{{ computed.iconStyle({ iconSize, checkedColor, disabled, parentDisabled, value, name }) }}"
                wx:else
        />
    </view>
    <view
            bindtap="onClickLabel"
            class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
            wx:if="{{ labelPosition === 'right' }}"
    >
        <slot/>
    </view>
</view>
