Mercurial > gemma
annotate client/src/components/ui/UISpinnerButton.vue @ 5307:4ba3fda13c50 zpg-exception
Fixed typo in migration script.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 28 May 2021 11:17:12 +0200 |
parents | b22f84d312f2 |
children |
rev | line source |
---|---|
2898
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2918
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
2 <div :class="classesString" @click="$emit('click')"> |
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
3 <font-awesome-icon :icon="iconString" :spin="loading" fixed-width /> |
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
4 <slot /> |
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
5 </div> |
2898
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 </template> |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 <script> |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 * without warranty, see README.md and license for details. |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 * |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 * SPDX-License-Identifier: AGPL-3.0-or-later |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 * License-Filename: LICENSES/AGPL-3.0.txt |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 * |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 * Copyright (C) 2018 by via donau |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 * – Österreichische Wasserstraßen-Gesellschaft mbH |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 * Software engineering by Intevation GmbH |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 * |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 * Author(s): |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 * Markus Kottländer <markus.kottlaender@intevation.de> |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 */ |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 export default { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 props: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 loading: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 type: Boolean, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 default: false |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 state: [Number, Boolean], |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 icons: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 type: [String, Array], |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 default: () => ["angle-down", "angle-up"] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
32 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 classes: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 type: [String, Array], |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 default: () => ["text-info", "text-white"] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 } |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 computed: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 classesString() { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 return ( |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 "pointer " + |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 (Array.isArray(this.classes) |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 ? this.classes[Number(this.state)] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
44 : this.classes) |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 ); |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 iconString() { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 return this.loading |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 ? "spinner" |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 : Array.isArray(this.icons) |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 ? this.icons[Number(this.state)] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 : this.icons; |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 } |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 } |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 }; |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 </script> |