commit
8f75fbc573
10 changed files with 42 additions and 30 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
v-if="backButtonAction"
|
@click="handleClick"
|
||||||
@click="backButtonAction"
|
|
||||||
class="back-button-wrapper p-3"
|
class="back-button-wrapper p-3"
|
||||||
:aria-label="backButtonAccessibleText"
|
:aria-label="backButtonAccessibleText"
|
||||||
>
|
>
|
||||||
|
|
@ -20,12 +19,13 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
|
||||||
backButtonAction: {
|
|
||||||
type: Function,
|
|
||||||
default: null,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
this.$emit('click-event');
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -6,16 +6,17 @@
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</span>
|
</span>
|
||||||
<buttonBack
|
<buttonBack
|
||||||
v-if="hasBackButton"
|
v-if="hasBackButton"
|
||||||
:backButtonAction="backButtonAction"
|
:backButtonAccessibleText="backButtonAccessibleText"
|
||||||
/>
|
@click-event="clickEvent"
|
||||||
</h5>
|
/>
|
||||||
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import buttonBack from "@/ux-components/button-back/button-back";
|
import buttonBack from "@/common-components/button-back/button-back";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "FunnelSubHeader",
|
name: "FunnelSubHeader",
|
||||||
|
|
@ -28,12 +29,14 @@ export default {
|
||||||
hasBackButton: Boolean,
|
hasBackButton: Boolean,
|
||||||
backButtonUrl: String,
|
backButtonUrl: String,
|
||||||
backButtonAccessibleText: String,
|
backButtonAccessibleText: String,
|
||||||
backButtonAction: Function,
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
buttonBack,
|
buttonBack,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clickEvent() {
|
||||||
|
this.$emit('click-event');
|
||||||
|
},
|
||||||
initializeComponent(cmsContent) {
|
initializeComponent(cmsContent) {
|
||||||
this.text = cmsContent.HeaderText;
|
this.text = cmsContent.HeaderText;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -739,7 +739,7 @@
|
||||||
<script>
|
<script>
|
||||||
import buttonPrimary from "@/ux-components/button-primary/button-primary";
|
import buttonPrimary from "@/ux-components/button-primary/button-primary";
|
||||||
import buttonSecondary from "@/ux-components/button-secondary/button-secondary";
|
import buttonSecondary from "@/ux-components/button-secondary/button-secondary";
|
||||||
import buttonBack from "@/ux-components/button-back/button-back";
|
import buttonBack from "@/common-components/button-back/button-back";
|
||||||
import listCard from "@/ux-components/list-card/list-card";
|
import listCard from "@/ux-components/list-card/list-card";
|
||||||
import listButton from "@/ux-components/list-button/list-button";
|
import listButton from "@/ux-components/list-button/list-button";
|
||||||
import alert from "@/ux-components/alert/alert";
|
import alert from "@/ux-components/alert/alert";
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
ref="funnelSubHeader"
|
ref="funnelSubHeader"
|
||||||
:hasBackButton="true"
|
:hasBackButton="true"
|
||||||
backButtonAccessibleText="Change Vehicle Year"
|
backButtonAccessibleText="Change Vehicle Year"
|
||||||
:backButtonAction="backButtonAction"
|
@click-event="backButtonAction"
|
||||||
class="Header"
|
class="Header"
|
||||||
/>
|
/>
|
||||||
<makeQuestion v-model="selectedMake" ref="makeQuestion" />
|
<makeQuestion v-model="selectedMake" ref="makeQuestion" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -64,7 +64,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
backButtonAction: function () {
|
backButtonAction() {
|
||||||
// route to move backwards
|
// route to move backwards
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
ref="funnelSubHeader"
|
ref="funnelSubHeader"
|
||||||
:hasBackButton="true"
|
:hasBackButton="true"
|
||||||
backButtonAccessibleText="Change Vehicle Make"
|
backButtonAccessibleText="Change Vehicle Make"
|
||||||
:backButtonAction="backButtonAction"
|
@click-event="backButtonAction"
|
||||||
class="Header"
|
class="Header"
|
||||||
/>
|
/>
|
||||||
<modelQuestion v-model="selectedModel" ref="modelQuestion" />
|
<modelQuestion v-model="selectedModel" ref="modelQuestion" />
|
||||||
|
|
@ -64,7 +64,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
backButtonAction: function () {
|
backButtonAction() {
|
||||||
// route to move backwards
|
// route to move backwards
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
ref="funnelSubHeader"
|
ref="funnelSubHeader"
|
||||||
:hasBackButton="true"
|
:hasBackButton="true"
|
||||||
backButtonAccessibleText="Change Vehicle Model"
|
backButtonAccessibleText="Change Vehicle Model"
|
||||||
:backButtonAction="backButtonAction"
|
@click-event="backButtonAction"
|
||||||
class="Header"
|
class="Header"
|
||||||
/>
|
/>
|
||||||
<styleQuestion v-model="selectedStyle" ref="styleQuestion" />
|
<styleQuestion v-model="selectedStyle" ref="styleQuestion" />
|
||||||
|
|
@ -64,7 +64,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
backButtonAction: function () {
|
backButtonAction() {
|
||||||
// route to move backwards
|
// route to move backwards
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ describe("list-button.vue", () => {
|
||||||
groupName: "TestGroup",
|
groupName: "TestGroup",
|
||||||
loaderColor: "blue",
|
loaderColor: "blue",
|
||||||
loaderPosition: "right",
|
loaderPosition: "right",
|
||||||
|
loaderEnabled: "true",
|
||||||
sizeInRem: "1.5",
|
sizeInRem: "1.5",
|
||||||
errorMessage: "null",
|
errorMessage: "null",
|
||||||
},
|
},
|
||||||
|
|
@ -20,7 +21,7 @@ describe("list-button.vue", () => {
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
const paragraph = wrapper.find("span");
|
const paragraph = wrapper.find("span");
|
||||||
|
|
||||||
await label.trigger("click");
|
await input.trigger("click");
|
||||||
|
|
||||||
expect(input.attributes()).toEqual({
|
expect(input.attributes()).toEqual({
|
||||||
id: "2023",
|
id: "2023",
|
||||||
|
|
@ -33,6 +34,7 @@ describe("list-button.vue", () => {
|
||||||
expect(label.attributes()).toEqual({
|
expect(label.attributes()).toEqual({
|
||||||
tabindex: "-1",
|
tabindex: "-1",
|
||||||
for: "2023",
|
for: "2023",
|
||||||
|
"aria-labelledby": "2023",
|
||||||
class: "d-flex flex-column justify-content-center py-3 px-4 last-item",
|
class: "d-flex flex-column justify-content-center py-3 px-4 last-item",
|
||||||
"aria-checked": "false",
|
"aria-checked": "false",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<!-- IMPORTANT: Refrain from using more than 4 horizontal buttons on desktop, 3 on mobile. -->
|
<!-- IMPORTANT: Refrain from using more than 4 horizontal buttons on desktop, 3 on mobile. -->
|
||||||
<div v-if="isMultiSelect" class="list-group list-button-horizontal d-flex flex-column w-100 mb-2">
|
<div v-if="isMultiSelect" class="list-group list-button-horizontal d-flex flex-column w-100 mb-2">
|
||||||
<input type="checkbox" :id="buttonID" :name="groupName" :value="buttonID" :aria-required="isRequired">
|
<input type="checkbox" :id="buttonID" :name="groupName" :value="buttonID" :aria-required="isRequired">
|
||||||
<label tabindex="-1" aria-checked="false" :for="buttonID" class="d-flex flex-column justify-content-center py-3 px-4" :class="isFirstOrLastButton">
|
<label tabindex="-1" aria-checked="false" :for="buttonID" :aria-labelledby="buttonID" class="d-flex flex-column justify-content-center py-3 px-4" :class="isFirstOrLastButton">
|
||||||
<span class="m-0" :class="[this.textPosition]">{{buttonID}}</span>
|
<span class="m-0" :class="[this.textPosition]">{{buttonID}}</span>
|
||||||
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="[this.textPosition]">{{buttonLabelSubCopy}}</span>
|
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="[this.textPosition]">{{buttonLabelSubCopy}}</span>
|
||||||
<span v-if="screenReaderOnlyText" class="sr-only">{{screenReaderOnlyText}}</span>
|
<span v-if="screenReaderOnlyText" class="sr-only">{{screenReaderOnlyText}}</span>
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
<p class="small">{{errorMessage}}</p>
|
<p class="small">{{errorMessage}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="col list-group list-button-horizontal d-flex flex-column mb-2">
|
<div v-else class="col list-group list-button-horizontal d-flex flex-column mb-2">
|
||||||
<input type="radio" :id="buttonID" :name="groupName" :value="buttonID" aria-required="true" @keyup.space="displayLoader()"/>
|
<input type="radio" :id="buttonID" :name="groupName" :value="buttonID" aria-required="true" @keyup.space="handleClick()" @click="handleClick()" />
|
||||||
<label tabindex="-1" aria-checked="false" :for="buttonID" class="d-flex flex-column justify-content-center py-3 px-4" :class="isFirstOrLastButton" @click="displayLoader()">
|
<label tabindex="-1" aria-checked="false" :for="buttonID" :aria-labelledby="buttonID" class="d-flex flex-column justify-content-center py-3 px-4" :class="isFirstOrLastButton">
|
||||||
<span class="m-0" :class="[this.textPosition]">{{buttonID}}</span>
|
<span class="m-0" :class="[this.textPosition]">{{buttonID}}</span>
|
||||||
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="[this.textPosition]">{{buttonLabelSubCopy}}</span>
|
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="[this.textPosition]">{{buttonLabelSubCopy}}</span>
|
||||||
<span v-if="screenReaderOnlyText" class="sr-only">{{screenReaderOnlyText}}</span>
|
<span v-if="screenReaderOnlyText" class="sr-only">{{screenReaderOnlyText}}</span>
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import loader from "@/ux-components/loader/loader";
|
import loader from "@/ux-components/loader/loader";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "listButtonHorizontal",
|
name: "listButtonHorizontal",
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -34,11 +35,13 @@ export default {
|
||||||
screenReaderOnlyText: String, /* Optional, copy to be read by screenreader */
|
screenReaderOnlyText: String, /* Optional, copy to be read by screenreader */
|
||||||
textPosition: String, /* Optional, use Bootstrap classes: text-start, text-center, text-end. Default (empty) is text-start */
|
textPosition: String, /* Optional, use Bootstrap classes: text-start, text-center, text-end. Default (empty) is text-start */
|
||||||
errorMessage: String, /* Optional, if there is an error message to be displayed */
|
errorMessage: String, /* Optional, if there is an error message to be displayed */
|
||||||
|
loaderEnabled: Boolean, /* Optional, need to include this for loader to be used at all */
|
||||||
loaderColor: String, /* Specify color of loader/spinner. Options are blue, red, green, white, black. Default is blue */
|
loaderColor: String, /* Specify color of loader/spinner. Options are blue, red, green, white, black. Default is blue */
|
||||||
loaderPosition: String, /* Specify horizontal position of loader/spinner. Options are center, right, left */
|
loaderPosition: String, /* Specify horizontal position of loader/spinner. Options are center, right, left */
|
||||||
sizeInRem: [Number,String], /* Specify size of loader/spinner in rem. Example: 1.5 (equals 24px (16x1.5)) */
|
sizeInRem: [Number,String], /* Specify size of loader/spinner in rem. Example: 1.5 (equals 24px (16x1.5)) */
|
||||||
totalInGroup: Number, /* Required, total number of buttons in group. Used to tell first and last in group to apply border radius. */
|
totalInGroup: Number, /* Required, total number of buttons in group. Used to tell first and last in group to apply border radius. */
|
||||||
positionInGroup: Number /* Rquired, position of button in group. Example, 1,2,3 */
|
positionInGroup: Number, /* Required, position of button in group. Example, 1,2,3 */
|
||||||
|
isRequired: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -49,6 +52,9 @@ export default {
|
||||||
displayLoader() {
|
displayLoader() {
|
||||||
this.isLoaderDisplayed = true;
|
this.isLoaderDisplayed = true;
|
||||||
},
|
},
|
||||||
|
handleClick() {
|
||||||
|
this.loaderEnabled && this.displayLoader();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
loader,
|
loader,
|
||||||
|
|
@ -66,6 +72,7 @@ export default {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.list-button-horizontal {
|
.list-button-horizontal {
|
||||||
input[type="radio"],
|
input[type="radio"],
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,10 @@ export default {
|
||||||
name: "listCard",
|
name: "listCard",
|
||||||
props: {
|
props: {
|
||||||
//Must choose one of the following four options
|
//Must choose one of the following four options
|
||||||
isMultiSelect: Boolean,//Defines use as checkbox
|
isMultiSelect: Boolean, //Defines use as checkbox
|
||||||
isRadio: Boolean,//Defines use as radio button
|
isRadio: Boolean, //Defines use as radio button
|
||||||
isMultiSelectHorizontal: Boolean,//Defines use as horizontal checkbox
|
isMultiSelectHorizontal: Boolean, //Defines use as horizontal checkbox
|
||||||
isRadioHorizontal: Boolean,//Defines use as horizontal radio button
|
isRadioHorizontal: Boolean, //Defines use as horizontal radio button
|
||||||
//end must choose
|
//end must choose
|
||||||
buttonImage: String,//Optional: File name of image
|
buttonImage: String,//Optional: File name of image
|
||||||
buttonLabel: String,//Required: Label text
|
buttonLabel: String,//Required: Label text
|
||||||
|
|
@ -55,7 +55,7 @@ export default {
|
||||||
groupName: String,//Rquired: Unique
|
groupName: String,//Rquired: Unique
|
||||||
buttonLabelSubCopy: String,//Optional: sub text
|
buttonLabelSubCopy: String,//Optional: sub text
|
||||||
hasError: Boolean//Used to show error state
|
hasError: Boolean//Used to show error state
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue