diff --git a/src/common-components/input-button-wrapper/input-button-wrapper.vue b/src/common-components/base-input-button/base-input-button.vue similarity index 50% rename from src/common-components/input-button-wrapper/input-button-wrapper.vue rename to src/common-components/base-input-button/base-input-button.vue index 57fe58505..54fcc3b7d 100644 --- a/src/common-components/input-button-wrapper/input-button-wrapper.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -3,12 +3,6 @@ :class="[buttonWrapperClasses, { 'has-error': errors.length > 0 }]" :for="buttonId" @mousedown.left="handleEventAction('click', $event)"> - - click, keypress - // space => keypressSubmit, keypress - // arrow left/right => keypress - - // if selectOnKeypress (YMMS) - // if click => emit event - // if space/enter => emit event - // if arrow => emit event - // else (!selectOnKeypress) - // if click => emit event - // if space/enter => emit event - // if arrow => handleSelection - - // if ((!this.selectOnKeypress && eventType === "click") || (this.selectOnKeypress && eventType === "keypress")) { - // this.handleClick(e); - // } - // else { - // this.handleSelectionChange(e); - // } }, handleSelectionChange(e) { - // console.log("HSC"); - // console.log(e); - // console.log(this.value); - // console.log(this.modelValue); - // let isChecked = event.target.checked; - // console.log("BM value: ", this.value); - // let valueToEmit; - // console.log("isMultiselect") - // console.log(this.isMultiSelect) - // console.log({ - // modelValue: this.modelValue, - // isMultiselect: this.isMultiSelect - // }) if ( this.isMultiSelect && (this.modelValue instanceof Array || this.modelValue == null) ) { let newValue = this.modelValue ? [...this.modelValue] : []; - // console.log("newValue", newValue) - // console.log({ - // newValue: newValue, - // // isChecked: isChecked - // }) if (!newValue.includes(this.value)) { - // console.log("isChecked") newValue.push(this.value); } else { - // console.log("isn't checked") newValue.splice(newValue.indexOf(this.value), 1); } this.valueToEmit = newValue; } else { - // console.log("not multi"); this.valueToEmit = this.value; } - console.log("handlingChange", this.valueToEmit); this.handleChange(this.valueToEmit); this.pushClickEventToGA(); - // if (this.selectOnKeypress) { - // this.handleClick(e) - // } }, handleClick(e) { - // console.log("handleClick"); this.handleSelectionChange(e); - // console.log("HC"); - // console.log({ - // eventEmitting: e, - // valueToEmit: this.valueToEmit, - // }); this.$emit("change", this.valueToEmit); }, pushClickEventToGA() { @@ -284,7 +161,7 @@ export default { return this.isMultiSelect ? "checkbox" : "radio"; }, buttonId() { - return `${this.groupName} ${JSON.stringify(this.value)}`; + return `${this.groupName}-${JSON.stringify(this.value).replace(" ", "-")}`; }, }, setup(props) { @@ -294,41 +171,18 @@ export default { type: inputType, validateOnValueUpdate: false, validateOnMount: false, - // checkedValue: props.value, - // potentialInitialValue: props.selectedValues, }; - // Set initialValue for validation setup if pre-selected - // NOTE: props.selectedValues could be an array of strings, or an array of integers... - // if ( - // props.selectedValues && - // (props.selectedValues.includes(props.value) || - // props.selectedValues.includes(parseInt(props.value))) - // ) { - // fieldOptions["initialValue"] = fieldOptions.potentialInitialValue; - // } - - // const { handleChange, errors, value } = useField( - // toRef(props, "groupName"), - // toRef(props, "validationRules"), - // fieldOptions - // ); - - console.log(props.validationRules); - const { handleChange, meta, errors, value } = useField( toRef(props, "groupName"), toRef(props, "validationRules"), fieldOptions ); - // const validateValue = value; - return { handleChange, errors, meta, - // validateValue, fieldOptions, // only need to expose this for unit test purposes }; }, diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 2fece851c..51dd15f77 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -52,34 +52,6 @@ :textPosition="textPosition" :selectOnKeypress="selectOnKeypress" @change="handleAnswerChange" /> - -
({ + buttonLabel: answer.Text ?? answer, + altText: answer.Name ? answer.Name : answer, + buttonLabelSubCopy: answer.SubText, + buttonImage: answer.AnswerImageUrl, + buttonImageId: answer.ImageId, + groupName: this.formatString(this.groupName), + value: this.useTextForValue + ? answer.Text + : answer.Name ?? answer, + })); // TODO KO temporary. It should always just be an array - return (Array.isArray(this.answers) ? this.answers : [])?.map( - (answer) => ({ - buttonLabel: answer.Text ?? answer, - altText: answer.Name ? answer.Name : answer, - buttonLabelSubCopy: answer.SubText, - buttonImage: answer.AnswerImageUrl, - buttonImageId: answer.ImageId, - groupName: this.formatString(this.groupName), - value: this.useTextForValue - ? answer.Text - : answer.Name ?? answer, - }) - ); + // return (Array.isArray(this.answers) ? this.answers : [])?.map( + // (answer) => ({ + // buttonLabel: answer.Text ?? answer, + // altText: answer.Name ? answer.Name : answer, + // buttonLabelSubCopy: answer.SubText, + // buttonImage: answer.AnswerImageUrl, + // buttonImageId: answer.ImageId, + // groupName: this.formatString(this.groupName), + // value: this.useTextForValue + // ? answer.Text + // : answer.Name ?? answer, + // }) + // ); }, }, methods: { @@ -249,26 +224,10 @@ export default { : this.formatString(answer.toString()); } }, - // handleCheckedChanged(val) { - // if (this.selectingInitiatesLoad) { - // this.selectedValues = val.value; - // } else { - // if (Array.isArray(this.selectedValues)) { - // const newSelectedValues = this.selectedValues; - // val.checkValue - // ? newSelectedValues.push(val.value) - // : newSelectedValues.splice(newSelectedValues.indexOf(val.value), 1); - // this.selectedValues = newSelectedValues; - // } else { - // this.selectedValues = val.value; - // } - // } - // this.$emit("isCheckedChanged", val); - // }, handleAnswerChange(primaryAnswerValue) { console.log({ - bqEvent: primaryAnswerValue - }) + bqEvent: primaryAnswerValue, + }); this.primaryValue = primaryAnswerValue; this.$emit("change", primaryAnswerValue); this.$emit("update:modelValue", primaryAnswerValue); diff --git a/src/layouts/quote/cash-or-insurance-question/cash-or-insurance-question.vue b/src/layouts/quote/cash-or-insurance-question/cash-or-insurance-question.vue index b2431406d..3e96fba94 100644 --- a/src/layouts/quote/cash-or-insurance-question/cash-or-insurance-question.vue +++ b/src/layouts/quote/cash-or-insurance-question/cash-or-insurance-question.vue @@ -6,39 +6,40 @@ buttonType="listButtonHorizontal" v-model="selectedValues" isCashOrInsurance - isRequired - /> + isRequired />
\ No newline at end of file +}; + diff --git a/src/layouts/vehicle-damage/windshield-options/windshield-chip-count-question/windshield-chip-count-question.vue b/src/layouts/vehicle-damage/windshield-options/windshield-chip-count-question/windshield-chip-count-question.vue index f0aa82252..af063722f 100644 --- a/src/layouts/vehicle-damage/windshield-options/windshield-chip-count-question/windshield-chip-count-question.vue +++ b/src/layouts/vehicle-damage/windshield-options/windshield-chip-count-question/windshield-chip-count-question.vue @@ -24,21 +24,11 @@ export default ({ name: "windshieldOptions", mixins: [buttonQuestionWrapperMixin], props: { - // modelValue: Number, groupName: String, isAvailable: Boolean, validationRules: String, cmsWidgetName: String, }, - // methods: { - // // TODO KO is this being used? Always three options - // updateSelectedValues() { - // // UPDATE SELECTEDVALUES IF ONLY ONE ANSWER - // if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1 && this.selectedValues) { - // this.selectedValues = [this.answersToDisplay[0].Name]; - // } - // }, - // }, computed: { questionText(){ return this.getCmsContent(this.cmsWidgetName, 'QuestionText'); @@ -47,12 +37,6 @@ export default ({ return this.getCmsContent(this.cmsWidgetName, 'Answers'); }, }, - // watch: { - // isAvailable(val) { - // // CHECK TO UPDATE SELECTED VALUES WHEN ISAVAILABLE IS TRUE - // val && this.updateSelectedValues(); - // } - // }, components: { buttonQuestion, } diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 49d5f2a40..2c409e102 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -115,7 +115,6 @@ export default { // if single parts only const collectedGlassParts = this.reducedGlassPartsArray(partsOrQuestions); // save to store lineItems.glassParts - // TODO KO self.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); self.$refs.loadingModal.showModal(); diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue index 5fb41f2f6..d8a9584fc 100644 --- a/src/ux-components/list-button-horizontal/list-button-horizontal.vue +++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue @@ -1,35 +1,35 @@ diff --git a/src/ux-components/list-button/list-button.vue b/src/ux-components/list-button/list-button.vue index 85c85d140..72f7329ae 100644 --- a/src/ux-components/list-button/list-button.vue +++ b/src/ux-components/list-button/list-button.vue @@ -1,276 +1,140 @@ diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index edd9dddfd..d05655619 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -1,5 +1,5 @@ @@ -260,9 +117,6 @@ export default { input[type="checkbox"], input[type="radio"] { - // opacity: 0; - // width: 0; - // height: 0.1px; // NOTE: cannot be zero or safari can't put focus on it position: absolute; + .list-card-content { diff --git a/src/ux-components/radio/radio.vue b/src/ux-components/radio/radio.vue index 8a136c2d2..5f1f81b38 100644 --- a/src/ux-components/radio/radio.vue +++ b/src/ux-components/radio/radio.vue @@ -1,6 +1,5 @@