Merge pull request #355 from Safelite/feature/digital/SSR-468.2
Feature/digital/ssr 468.2
This commit is contained in:
commit
d3fa094f72
4 changed files with 72 additions and 64 deletions
|
|
@ -121,9 +121,7 @@ export default {
|
|||
return this.isMultiSelect ? "checkbox" : "radio";
|
||||
},
|
||||
buttonId() {
|
||||
return `${this.groupName?.replace(" ", "-")}-${this.value
|
||||
?.toString()
|
||||
?.replace(" ", "-")}`;
|
||||
return `${this.groupName}-${this.value}`.replaceAll(" ", "-");
|
||||
},
|
||||
isValueSelectedOnClick() {
|
||||
return this.isMultiSelect || this.selectingInitiatesLoad;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<div
|
||||
:class="getComponentWrapperClasses"
|
||||
v-for="answer in buttonsInfo"
|
||||
:key="answer.value ? answer.value : answer">
|
||||
:key="answer.value ?? answer">
|
||||
<component
|
||||
:is="buttonTypeString"
|
||||
:buttonLabel="answer.buttonLabel"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
:isWide="true"
|
||||
altText=""
|
||||
isRequired
|
||||
:groupName="`${glassLocation}-${glassName}`"
|
||||
:groupName="replaceAllSpaceWithDash(`${glassLocation}-${glassName}`)"
|
||||
:validationRules="tintValidationRules">
|
||||
<div class="row my-2" aria-live="polite">
|
||||
<div class="col">
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
:loaderEnabled="false"
|
||||
isRequired
|
||||
isSmallQuestionText
|
||||
:groupName="`${glassLocation}-${glassName}-${selectedTint}`"
|
||||
:groupName="replaceAllSpaceWithDash(`${glassLocation}-${glassName}-${selectedTint}`)"
|
||||
:validationRules="partValidationRules" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -210,6 +210,10 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
replaceAllSpaceWithDash(str) {
|
||||
return String(str).replaceAll(" ", "-");
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
selectedTint() {
|
||||
|
|
|
|||
|
|
@ -76,69 +76,75 @@ export default {
|
|||
value: inputValue,
|
||||
handleChange,
|
||||
errors,
|
||||
resetField
|
||||
} = useField(props.groupName, props.validationRules,
|
||||
{
|
||||
type: inputType,
|
||||
checkedValue: props.value,
|
||||
});
|
||||
return {
|
||||
handleChange,
|
||||
errors,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
{
|
||||
type: inputType
|
||||
});
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-check {
|
||||
position: relative;
|
||||
return {
|
||||
handleChange,
|
||||
errors,
|
||||
resetField
|
||||
};
|
||||
},
|
||||
unmounted(){
|
||||
this.resetField();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
label {
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.form-check-input {
|
||||
border: 1px solid $gray-500;
|
||||
border-radius: 50%;
|
||||
margin-right: 0.5rem;
|
||||
|
||||
&:checked {
|
||||
background-color: $white;
|
||||
background-size: 71%;
|
||||
background-position: center;
|
||||
border: 1px solid $blue;
|
||||
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' xml:space='preserve'%3e%3ccircle cx='25' cy='25' r='25' fill='%231574A1'/%3e%3c/svg%3e");
|
||||
+ label {
|
||||
p {
|
||||
font-weight: 500;
|
||||
font-size: .875rem;
|
||||
color: $black;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2.5px $blue;
|
||||
}
|
||||
|
||||
&, & + label {
|
||||
margin-top: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
.form-check {
|
||||
position: relative;
|
||||
|
||||
label {
|
||||
&:hover {
|
||||
.form-check-input {
|
||||
box-shadow: 0 0 0 4px $blue-300;
|
||||
}
|
||||
}
|
||||
p {
|
||||
font-weight: 400;
|
||||
font-size: .875rem;
|
||||
color: $gray-600;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
.form-check-input {
|
||||
border: 1px solid $gray-500;
|
||||
border-radius: 50%;
|
||||
margin-right: 0.5rem;
|
||||
|
||||
&:checked {
|
||||
background-color: $white;
|
||||
background-size: 71%;
|
||||
background-position: center;
|
||||
border: 1px solid $blue;
|
||||
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' xml:space='preserve'%3e%3ccircle cx='25' cy='25' r='25' fill='%231574A1'/%3e%3c/svg%3e");
|
||||
+ label {
|
||||
p {
|
||||
font-weight: 500;
|
||||
font-size: .875rem;
|
||||
color: $black;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2.5px $blue;
|
||||
}
|
||||
|
||||
&, & + label {
|
||||
margin-top: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.form-check-input {
|
||||
box-shadow: 0 0 0 4px $blue-300;
|
||||
}
|
||||
}
|
||||
p {
|
||||
font-weight: 400;
|
||||
font-size: .875rem;
|
||||
color: $gray-600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue