<wux-cell-group
    id="wux-cell-group"
    wux-class="{{ prefixCls }}"
    prefixCls="{{ cellGroupPrefixCls }}"
    title="{{ title }}"
    label="{{ label }}"
    mode="{{ mode }}"
    bodyStyle="{{ bodyStyle }}"
    hasLine="{{ !hasFieldDecorator ? hasLine : false }}"
    wx:if="{{ withListComponent }}"
>
    <block wx:for="{{ common.getOptions(options, fieldNames) }}" wx:for-item="option" wx:key="__comp_unique_key" wx:if="{{ options.length > 0 }}">
        <wux-checkbox
            class="{{ prefixCls + '__checkbox' }}"
            prefixCls="{{ option.prefixCls || 'wux-checkbox' }}"
            cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
            selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
            title="{{ option.title || '' }}"
            label="{{ option.label || '' }}"
            extra="{{ option.extra || '' }}"
            value="{{ option.value || '' }}"
            checked="{{ common.getChecked(inputValue, option.value) }}"
            disabled="{{ option.disabled || disabled }}"
            readOnly="{{ option.readOnly || readOnly }}"
            color="{{ option.color || 'balanced' }}"
            data-index="{{ index }}"
            bind:change="onCheckboxChange"
        />
    </block>
    <block wx:if="{{ options.length === 0 }}">
        <slot></slot>
    </block>
</wux-cell-group>
<block wx:else>
    <block wx:for="{{ common.getOptions(options, fieldNames) }}" wx:for-item="option" wx:key="__comp_unique_key" wx:if="{{ options.length > 0 }}">
        <wux-checkbox
            class="{{ prefixCls + '__checkbox' }}"
            prefixCls="{{ option.prefixCls || 'wux-checkbox' }}"
            cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
            selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
            title="{{ option.title || '' }}"
            label="{{ option.label || '' }}"
            extra="{{ option.extra || '' }}"
            value="{{ option.value || '' }}"
            checked="{{ common.getChecked(inputValue, option.value) }}"
            disabled="{{ option.disabled || disabled }}"
            readOnly="{{ option.readOnly || readOnly }}"
            color="{{ option.color || 'balanced' }}"
            data-index="{{ index }}"
            bind:change="onCheckboxChange"
        />
    </block>
    <block wx:if="{{ options.length === 0 }}">
        <slot></slot>
    </block>
</block>
<wxs src="../helpers/wxs/common.wxs" module="common" />
