Refactor method, add prop.

This commit is contained in:
Bryan Mauger 2023-02-03 10:55:12 -05:00
parent 5c3937798b
commit 31d787d62d
3 changed files with 33 additions and 9 deletions

View file

@ -5,7 +5,10 @@ https://safelite.atlassian.net/wiki/spaces/DC/pages/76644418/Button+Question+Com
:class=" :class="
isOverflowScrollable ? 'button-question button-question-overflow' : 'button-question' isOverflowScrollable ? 'button-question button-question-overflow' : 'button-question'
"> ">
<div v-if="questionText && answers && answers.length > 0" class="question-text d-flex"> <div
v-if="questionText && answers && answers.length > 0"
class="question-text d-flex"
:class="{ 'small-question-text': isSmallQuestionText }">
<span class="fw-bold w-100">{{ questionText }}</span> <span class="fw-bold w-100">{{ questionText }}</span>
</div> </div>
@ -123,6 +126,7 @@ export default {
useTextForValue: Boolean, useTextForValue: Boolean,
valueToLogType: String, valueToLogType: String,
additionalButtonStyling: String, additionalButtonStyling: String,
isSmallQuestionText: Boolean,
}, },
beforeMount() { beforeMount() {
if (this.buttonTypeObject) { if (this.buttonTypeObject) {
@ -136,13 +140,15 @@ export default {
}, },
computed: { computed: {
getFieldSetClasses() { getFieldSetClasses() {
if (this.isOverflowScrollable) { const baseClasses = this.isOverflowScrollable
return "container-fluid overflow-scroll position-absolute px-5 pt-1 py-0"; ? "container-fluid overflow-scroll position-absolute px-5 pt-1 py-0"
} else if (this.buttonTypeString == "listCard") { : this.buttonTypeString == "listCard"
return "w-100"; ? "w-100"
} else { : "";
return ""; const withSmallQuestionClass = this.isSmallQuestionText
} ? baseClasses + " small-question-text"
: baseClasses;
return withSmallQuestionClass;
}, },
getComponentLoopWrapperClasses() { getComponentLoopWrapperClasses() {
let classes; let classes;
@ -255,4 +261,21 @@ export default {
text-align: center; text-align: center;
} }
} }
.small-question-text {
&.question-text {
span {
font-size: 0.875rem;
text-align: left;
margin: 1rem 0 0.5rem 0;
}
}
&.question-text {
margin: 0;
}
& fieldset {
.ui-radio {
margin: 0;
}
}
}
</style> </style>

View file

@ -25,6 +25,7 @@
textPosition="text-start" textPosition="text-start"
:loaderEnabled="false" :loaderEnabled="false"
isRequired isRequired
isSmallQuestionText
:groupName="`${glassLocation}-${glassName}-${selectedTint}`" :groupName="`${glassLocation}-${glassName}-${selectedTint}`"
:validationRules="partValidationRules" /> :validationRules="partValidationRules" />
</div> </div>

View file

@ -1,6 +1,6 @@
<template> <template>
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm"> <Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm">
<div class="page-container-grouped-styles vehicle-parts"> <div class="page-container-grouped-styles vehicle-parts small-question-text">
<loadingModal ref="loadingModal" /> <loadingModal ref="loadingModal" />
<funnelHeader ref="funnelHeader" cmsWidgetName="FunnelHeaderWidget" /> <funnelHeader ref="funnelHeader" cmsWidgetName="FunnelHeaderWidget" />
<vehicleBanner <vehicleBanner