Added property to loader to allow it not to block the UI

This commit is contained in:
Leah Schumann 2023-05-26 07:01:05 -04:00
parent d52e3135fc
commit 0b35fe5872
4 changed files with 27 additions and 16 deletions

View file

@ -256,7 +256,9 @@ export default {
}, },
watch: { watch: {
modelValue(newValue, oldValue) { modelValue(newValue, oldValue) {
this.resetField(); this.resetField({
value: newValue
});
}, },
answers() { answers() {
//once we get the answers to display from parent, see if we need a GA event to log what we showed //once we get the answers to display from parent, see if we need a GA event to log what we showed

View file

@ -23,7 +23,7 @@
}}</span> }}</span>
<loader <loader
v-if="isLoaderDisplayed" v-if="isLoaderDisplayed"
:class="[this.loaderColor, this.loaderPosition]" /> :class="[this.loaderColor, this.loaderPosition, this.blockUi]" />
</div> </div>
</div> </div>
<div class="row-two"> <div class="row-two">
@ -52,7 +52,7 @@ export default {
props: { props: {
loaderColor: String, loaderColor: String,
}, },
mounted() { async beforeMount() {
this.displayLoader(); this.displayLoader();
this.additionalButtonData.availabilityRatingCallback(this.modelValue).then((data) => { this.additionalButtonData.availabilityRatingCallback(this.modelValue).then((data) => {
this.availabilityRating = data; this.availabilityRating = data;
@ -66,6 +66,7 @@ export default {
availabilityRating: "None", availabilityRating: "None",
availabilityRatingClass: "", availabilityRatingClass: "",
loaderPosition: "left", loaderPosition: "left",
blockUi: "no-block"
}; };
}, },
methods: { methods: {
@ -123,10 +124,10 @@ export default {
&:checked + .list-button-content span { &:checked + .list-button-content span {
font-weight: 500; font-weight: 500;
} }
&:checked + .list-button-content span:nth-child(2) { // &:checked + .list-button-content span:nth-child(2) {
font-weight: 400; // font-weight: 400;
color: $gray-600; // color: $gray-600;
} // }
} }
} }
.list-button-content { .list-button-content {
@ -186,8 +187,8 @@ export default {
.loader { .loader {
padding: 0 0.25rem 0 0.25rem; padding: 0 0.25rem 0 0.25rem;
padding-top: 0.125rem;
//position: absolute; padding-bottom: 0.125rem;
} }
.loader:after { .loader:after {
@ -209,6 +210,8 @@ export default {
&.gray { &.gray {
color: $gray-600 !important; color: $gray-600 !important;
background-color: $gray-100; background-color: $gray-100;
padding-left: 0.125rem;
padding-right: 0.125rem;
} }
} }
} }

View file

@ -208,26 +208,24 @@ export default {
}, },
watch: { watch: {
selectedAppointmentType: { selectedAppointmentType: {
async handler(newValue) { async handler(newValue) {
this.resetAnswers(); this.resetAnswers();
await nextTick(); await nextTick();
this.selectedProviderNumber = null; this.selectedProviderNumber = null;
this.$refs.buttonQuestion?.resetField();
await nextTick(); await nextTick();
if (newValue !== "Mobile") { if (newValue !== "Mobile") {
await this.getNextShopsFromList(); this.getNextShopsFromList();
} }
}, },
}, },
shopProviders: { shopProviders: {
async handler(newValue) { async handler(newValue) {
await nextTick(); await nextTick();
if (this.selectedAppointmentType) { if (this.selectedAppointmentType) {
const selectedShopIndex = this.getSelectedProviderIndex( const selectedShopIndex = this.getSelectedProviderIndex(
newValue, newValue,

View file

@ -3,7 +3,7 @@
class="loader" class="loader"
role="alert" role="alert"
aria-label="Loading new page" aria-label="Loading new page"
v-bind:class="[this.loaderColor, this.loaderPosition]"></div> v-bind:class="[this.loaderColor, this.loaderPosition, this.blockUi]"></div>
</template> </template>
<script> <script>
@ -19,6 +19,10 @@ export default {
loaderPosition: { loaderPosition: {
type: String, type: String,
}, },
blockUi: {
type: Boolean,
default: true
}
}, },
}; };
</script> </script>
@ -82,5 +86,9 @@ export default {
&.black:after { &.black:after {
background-color: $black; background-color: $black;
} }
&.no-block::before {
z-index: -1;
}
} }
</style> </style>