@afeefa/vue-app 0.0.116 → 0.0.117
Sign up to get free protection for your applications and to get access to all the features.
- package/.afeefa/package/release/version.txt +1 -1
- package/package.json +1 -1
- package/src/components/ARadioGroup.vue +9 -0
- package/src/components/ASelect.vue +1 -1
- package/src/components/form/fields/FormFieldRadioGroup.vue +1 -3
- package/src-admin/components/App.vue +2 -2
- package/src-admin/plugins/AuthPlugin.js +3 -1
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.117
|
package/package.json
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
ref="radios"
|
4
4
|
:rules="validationRules"
|
5
5
|
:class="{hasLabel: $has.label}"
|
6
|
+
:valueComparator="compareValues"
|
6
7
|
v-bind="$attrs"
|
7
8
|
@change="$emit('input', $event)"
|
8
9
|
>
|
@@ -22,6 +23,7 @@
|
|
22
23
|
|
23
24
|
<script>
|
24
25
|
import { Component, Vue, Watch } from '@a-vue'
|
26
|
+
import { Model } from '@afeefa/api-resources-client'
|
25
27
|
|
26
28
|
@Component({
|
27
29
|
props: ['options', 'validator']
|
@@ -56,6 +58,13 @@ export default class ARadioGroup extends Vue {
|
|
56
58
|
}
|
57
59
|
}
|
58
60
|
|
61
|
+
compareValues (a, b) {
|
62
|
+
if (a instanceof Model && b instanceof Model) {
|
63
|
+
return a.equals(b)
|
64
|
+
}
|
65
|
+
return JSON.stringify(a) === JSON.stringify(b)
|
66
|
+
}
|
67
|
+
|
59
68
|
get validationRules () {
|
60
69
|
const label = this.$attrs.label
|
61
70
|
return (this.validator && this.validator.getRules(label)) || []
|
@@ -18,9 +18,7 @@ export default class FormFieldRadioGroup extends Mixins(FormFieldMixin) {
|
|
18
18
|
options = null
|
19
19
|
|
20
20
|
created () {
|
21
|
-
if (this.fieldHasOptionsRequest()) {
|
22
|
-
this.options = this.getSelectOptions()
|
23
|
-
} else if (this.fieldHasOptions()) {
|
21
|
+
if (this.fieldHasOptionsRequest() || this.fieldHasOptions()) {
|
24
22
|
this.options = this.getSelectOptions()
|
25
23
|
}
|
26
24
|
}
|
@@ -10,7 +10,9 @@ class AuthPlugin {
|
|
10
10
|
|
11
11
|
hasRole: name => authService.currentAccountHasRole(name),
|
12
12
|
|
13
|
-
roles
|
13
|
+
get roles () {
|
14
|
+
return authService.getCurrentAccountRoles()
|
15
|
+
},
|
14
16
|
|
15
17
|
logout: () => authService.forwardToLogoutEndpoint()
|
16
18
|
}
|