Re-add spinner to button.

This commit is contained in:
Bryan Mauger 2021-10-27 10:57:22 -04:00
parent ac416db4d8
commit 6edc1222a5
4 changed files with 135 additions and 15905 deletions

15979
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@
"test:unit": "vue-cli-service test:unit --coverage --coverageReporters=cobertura --coverageReporters=html --ci --watchAll=false --reporters=jest-junit --reporters=default"
},
"dependencies": {
"@popperjs/core": "^2.10.2",
"axios": "^0.23.0",
"bootstrap": "^5.1.1",
"canvas-confetti": "^1.4.0",

View file

@ -19,17 +19,26 @@
</div>
<div class="row">
<div class="col my-3 d-flex align-items-center">
<buttonPrimary buttonText="Primary" buttonType="btn-primary" />
<buttonPrimary
buttonText="Primary"
buttonType="btn-primary"
/>
</div>
</div>
<div class="row">
<div class="col my-3 d-flex align-items-center">
<buttonPrimary buttonText="Primary Focus" buttonType="btn-primary-focus" />
<buttonPrimary
buttonText="Primary Focus"
buttonType="btn-primary-focus"
/>
</div>
</div>
<div class="row">
<div class="col my-3 d-flex align-items-center">
<buttonPrimary buttonText="Disabled" buttonType="disabled" />
<buttonPrimary
buttonText="Disabled"
buttonType="disabled"
/>
</div>
</div>
<div class="row">

View file

@ -1,18 +1,17 @@
<template>
<button type="button" class="btn" v-bind:class="[(this.buttonType === 'btn-funnel' ? ['btn-funnel', 'border', 'rounded', 'w-100', 'text-start'] : this.buttonType)]" v-on:click="this.buttonType === 'btn-funnel' ? showLoader() : null">
<button
type="button"
class="btn d-flex align-items-center"
v-on:click="showLoader()"
v-bind:class="[(this.isLoading ? 'button-loader' : 'not-loading'),this.buttonType]"
>
{{ this.buttonText }}
<!-- Spinner for funnel Button -->
<div v-if="this.buttonType === 'btn-funnel' && this.isLoading" class="spinner-border spinner-border-sm text-success" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</button>
</template>
<script>
export default {
name: 'button',
name: 'buttonPrimary',
props: {
buttonText: String,
buttonType: String