commit
9916f132f8
6 changed files with 13 additions and 22 deletions
|
|
@ -6,7 +6,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="w-100 d-flex justify-content-center">
|
<div class="w-100 d-flex justify-content-center">
|
||||||
<fieldset class="w-100" :class="getFieldSetClasses" :role="isMultiSelect ? 'group' : 'radiogroup'" :aria-labelledby="groupName ? groupName + '-radio-group' : ''">
|
<fieldset class="w-100" :class="getFieldSetClasses" :role="isMultiSelect ? 'group' : 'radiogroup'" :aria-labelledby="groupName ? groupName + '-radio-group' : ''">
|
||||||
<legend class="sr-only">{{groupName}}</legend>
|
<legend class="sr-only" :data-focus-target="groupName" tabindex="-1">
|
||||||
|
{{(isMultiSelect && answers && answers.length > 1) ? 'Select one or more options below.' : 'Select an option below.' }}
|
||||||
|
</legend>
|
||||||
<div :class="getComponentWrapperClasses">
|
<div :class="getComponentWrapperClasses">
|
||||||
<component
|
<component
|
||||||
:is="buttonType"
|
:is="buttonType"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="textbox-question" :class="hasError ? 'has-error' : ''">
|
<div class="textbox-question" :class="(errors.length > 0 || hasError) ? 'has-error' : ''">
|
||||||
<label :for="inputId" :aria-label="questionText" class="form-label" v-html="labelText"></label>
|
<label :for="inputId" :aria-label="questionText" class="form-label" v-html="labelText"></label>
|
||||||
<input v-model="value"
|
<input v-model="value"
|
||||||
v-maska="mask"
|
v-maska="mask"
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,11 @@
|
||||||
input[type=radio]:focus + label {
|
input[type=radio]:focus + label {
|
||||||
box-shadow: 0 0 0 2.5px $red;
|
box-shadow: 0 0 0 2.5px $red;
|
||||||
}
|
}
|
||||||
input[type=checkbox]:focus + label:hover,
|
|
||||||
input[type=radio]:focus + label {
|
|
||||||
box-shadow: 0 0 0 1px $red;
|
|
||||||
}
|
|
||||||
&:hover {
|
&:hover {
|
||||||
box-shadow: 0px 0px 0px 4px $red-200;
|
box-shadow: 0px 0px 0px 4px $red-200;
|
||||||
border-radius: 10px !important;
|
border-radius: 10px !important;
|
||||||
border: 1px solid $red;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=checkbox]:checked + label,
|
|
||||||
input[type=radio]:checked + label {
|
|
||||||
box-shadow: 0 0 0 2.5px transparent !important;
|
|
||||||
}
|
|
||||||
&.list-button-horizontal {
|
&.list-button-horizontal {
|
||||||
color: $red;
|
color: $red;
|
||||||
label {
|
label {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="list-group list-button-horizontal d-flex flex-column w-100 mb-2"
|
class="list-group list-button-horizontal d-flex flex-column w-100 mb-2"
|
||||||
:class="[errors.length > 0 ? 'has-error' : '', hasError ? 'has-error' : '']"
|
:class="[(errors.length > 0 || hasError) ? 'has-error' : '']"
|
||||||
@mouseup="handleClick(value)"
|
@mouseup="handleClick(value)"
|
||||||
@keyup.space="handleClick(value)"
|
@keyup.space="handleClick(value)"
|
||||||
>
|
>
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
:name="groupName"
|
:name="groupName"
|
||||||
:value="value"
|
:value="value"
|
||||||
:aria-required="isRequired"
|
:aria-required="isRequired"
|
||||||
:data-focus-target="groupName"
|
|
||||||
v-model="checkValue"
|
v-model="checkValue"
|
||||||
@change="!selectingInitiatesLoad ? handleCheckChange() : ''"
|
@change="!selectingInitiatesLoad ? handleCheckChange() : ''"
|
||||||
/>
|
/>
|
||||||
|
|
@ -143,11 +142,11 @@ export default {
|
||||||
height: 0;
|
height: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
&:focus-visible + label {
|
&:focus-visible + label {
|
||||||
box-shadow: 0 0 0 2px $blue;
|
box-shadow: 0 0 0 2.5px $blue;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
&:focus + label {
|
&:focus + label {
|
||||||
box-shadow: 0 0 0 2px $blue;
|
box-shadow: 0 0 0 2.5px $blue;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
&:checked + label {
|
&:checked + label {
|
||||||
|
|
@ -156,6 +155,9 @@ export default {
|
||||||
outline: none;
|
outline: none;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
&:checked:focus + label {
|
||||||
|
box-shadow: 0 0 0 2.5px $blue;
|
||||||
|
}
|
||||||
&:checked + label p:first-child {
|
&:checked + label p:first-child {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="list-group list-button d-flex flex-column w-100 mb-2"
|
class="list-group list-button d-flex flex-column w-100 mb-2"
|
||||||
:class="[errors.length > 0 ? 'has-error' : '', hasError ? 'has-error' : '']"
|
:class="[(errors.length > 0 || hasError) ? 'has-error' : '']"
|
||||||
@mouseup="handleClick(value)"
|
@mouseup="handleClick(value)"
|
||||||
@keyup.space="handleClick(value)"
|
@keyup.space="handleClick(value)"
|
||||||
>
|
>
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
:name="groupName"
|
:name="groupName"
|
||||||
:value="value"
|
:value="value"
|
||||||
:aria-required="isRequired"
|
:aria-required="isRequired"
|
||||||
:data-focus-target="groupName"
|
|
||||||
v-model="checkValue"
|
v-model="checkValue"
|
||||||
@change="!selectingInitiatesLoad ? handleCheckChange() : ''"
|
@change="!selectingInitiatesLoad ? handleCheckChange() : ''"
|
||||||
>
|
>
|
||||||
|
|
@ -97,7 +96,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.handleChange(value);
|
this.handleChange(value);
|
||||||
},
|
},
|
||||||
handleCheckChange(newValue, oldValue){
|
handleCheckChange(value, oldValue){
|
||||||
const isInitialization = typeof(oldValue) === 'function';
|
const isInitialization = typeof(oldValue) === 'function';
|
||||||
if (!isInitialization) {
|
if (!isInitialization) {
|
||||||
const emitEvent = {
|
const emitEvent = {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@
|
||||||
class="list-card w-100 rounded-3 d-flex align-items-center h-100"
|
class="list-card w-100 rounded-3 d-flex align-items-center h-100"
|
||||||
:class="[
|
:class="[
|
||||||
isWide ? 'horizontal' : '',
|
isWide ? 'horizontal' : '',
|
||||||
errors.length > 0 ? 'has-error' : '',
|
(errors.length > 0 || hasError) ? 'has-error' : '',
|
||||||
hasError ? 'has-error' : '',
|
|
||||||
]"
|
]"
|
||||||
@mouseup="handleChange(value)"
|
@mouseup="handleChange(value)"
|
||||||
@keyup.space="handleChange(value)"
|
@keyup.space="handleChange(value)"
|
||||||
|
|
@ -16,7 +15,6 @@
|
||||||
:name="groupName"
|
:name="groupName"
|
||||||
:value="value"
|
:value="value"
|
||||||
:aria-required="isRequired"
|
:aria-required="isRequired"
|
||||||
:data-focus-target="groupName"
|
|
||||||
v-model="checkValue"
|
v-model="checkValue"
|
||||||
@change="handleCheckChange(value)"
|
@change="handleCheckChange(value)"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue