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

<view class="{{ utils.bem('checkbox', [{ horizontal: direction === 'horizontal' }]) }} custom-class">
    <view
            bindtap="onClickLabel"
            class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
            wx:if="{{ labelPosition === 'left' }}"
    >
        <slot/>
    </view>
    <view bindtap="toggle" class="van-checkbox__icon-wrap">
        <slot name="icon" wx:if="{{ useIconSlot }}"/>
        <van-icon
                class="{{ utils.bem('checkbox__icon', [shape, { disabled: disabled || parentDisabled, checked: value }]) }}"
                custom-class="icon-class"
                custom-style="line-height: 1.25em;"
                name="success"
                size="0.8em"
                style="{{ computed.iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) }}"
                wx:else
        />
    </view>
    <view
            bindtap="onClickLabel"
            class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
            wx:if="{{ labelPosition === 'right' }}"
    >
        <slot/>
    </view>
</view>
