| 1 |
<cx-vui-component-wrapper |
| 2 |
:elementId="currentId" |
| 3 |
:label="label" |
| 4 |
:description="description" |
| 5 |
:wrapper-css="wrapperCss" |
| 6 |
:preventWrap="preventWrap" |
| 7 |
v-if="isVisible()" |
| 8 |
> |
| 9 |
<div |
| 10 |
:class="{ |
| 11 |
'cx-vui-radiogroup': true, |
| 12 |
'cx-vui-radiogroup--single-item': this.optionsList.length === 1 |
| 13 |
}" |
| 14 |
:id="currentId" |
| 15 |
tabindex="0" |
| 16 |
> |
| 17 |
<div |
| 18 |
class="cx-vui-radio-wrap" |
| 19 |
v-for="( option, index ) in optionsList" |
| 20 |
> |
| 21 |
<div |
| 22 |
:key="name + option.value + index" |
| 23 |
:class="{ |
| 24 |
'cx-vui-radio': true, |
| 25 |
'cx-vui-radio--disabled': disabled, |
| 26 |
'cx-vui-radio--checked': option.value === currentValue, |
| 27 |
'cx-vui-radio--focused': isOptionInFocus( option.value ), |
| 28 |
}" |
| 29 |
@click="handleInput( $event, option.value )" |
| 30 |
@focus="handleFocus( $event, option.value )" |
| 31 |
@blur="handleBlur( $event, option.value )" |
| 32 |
tabindex="0" |
| 33 |
> |
| 34 |
<input |
| 35 |
:class="{ |
| 36 |
'cx-vui-radio__input': true, |
| 37 |
}" |
| 38 |
:name="name + '[' + option.value + ']'" |
| 39 |
:value="option.value" |
| 40 |
:checked="option.value === currentValue" |
| 41 |
:disabled="disabled" |
| 42 |
type="radio" |
| 43 |
> |
| 44 |
<div |
| 45 |
:class="{ |
| 46 |
'cx-vui-radio__mark': true, |
| 47 |
'cx-vui-radio__mark--disabled': disabled, |
| 48 |
'cx-vui-radio__mark--checked': option.value === currentValue, |
| 49 |
'cx-vui-radio__mark--focused': isOptionInFocus( option.value ), |
| 50 |
}" |
| 51 |
> |
| 52 |
</div> |
| 53 |
<div |
| 54 |
:class="{ |
| 55 |
'cx-vui-radio__label': true, |
| 56 |
}" |
| 57 |
v-html="option.label" |
| 58 |
></div> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
</div> |
| 62 |
</cx-vui-component-wrapper> |