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

<view class="{{ utils.bem('radio', [direction]) }} aio-class">
  <view
    wx:if="{{ labelPosition === 'left' }}"
    class="{{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }} label-class"
    bindtap="onClickLabel"
  >
    <slot />
  </view>
  <view class="aio-radio__icon-wrap" style="font-size: {{ utils.addUnit(iconSize) }}" bindtap="onChange">
    <slot wx:if="{{ useIconSlot }}" name="icon" />
    <aio-image wx:else width="{{ iconSize }}" height="{{ iconSize }}" name="{{ value === name ? activeImage : inActiveImage }}" />
  </view>
  <view
    wx:if="{{ labelPosition === 'right' }}"
    class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
    bindtap="onClickLabel"
  >
    <slot />
  </view>
</view>
