@afeefa/vue-app 0.0.111 → 0.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 0.0.111
1
+ 0.0.113
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.111",
3
+ "version": "0.0.113",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -158,4 +158,8 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin) {
158
158
  cursor: pointer;
159
159
  }
160
160
  }
161
+
162
+ .v-text-field :deep(.v-input__icon--clear) { // always show clear icon, https://github.com/vuetifyjs/vuetify/pull/15876
163
+ opacity: 1;
164
+ }
161
165
  </style>
@@ -20,7 +20,7 @@ import { debounce } from '@a-vue/utils/debounce'
20
20
  import { ComponentWidthMixin } from './mixins/ComponentWidthMixin'
21
21
 
22
22
  @Component({
23
- props: ['value', 'debounce', 'validator', 'rules', {dense: true, outlined: true, focus: false, number: false}]
23
+ props: ['value', 'debounce', 'validator', 'rules', {dense: true, outlined: true, clearable: false, focus: false, number: false}]
24
24
  })
25
25
  export default class ATextField extends Mixins(ComponentWidthMixin) {
26
26
  $hasOptions = ['counter']
@@ -71,14 +71,15 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
71
71
 
72
72
  attrs.dense = this.dense
73
73
  attrs.outlined = this.outlined
74
+ attrs.clearable = this.clearable
74
75
  return attrs
75
76
  }
76
77
 
77
78
  clear () {
78
- if (this.$attrs.clearable || this.escClearable) {
79
+ if (this.clearable) {
79
80
  this.setInternalValue('')
80
- this.validate()
81
81
  this.$emit('input', this.emptyValue)
82
+ this.validate()
82
83
  }
83
84
  }
84
85
 
@@ -86,12 +87,19 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
86
87
  this.$emit('input:internal', this.internalValue)
87
88
 
88
89
  const valid = this.validate()
90
+
89
91
  if (!valid) {
90
92
  return
91
93
  }
92
94
 
93
95
  const value = this.stringToNumber(this.internalValue)
94
96
 
97
+ // NaN means: wrong numerical value AND no validator present
98
+ // otherwise validator would return validate() -> false
99
+ if (Number.isNaN(value)) {
100
+ return
101
+ }
102
+
95
103
  if (this.debounce) {
96
104
  if (!this.debounceInputFunction) {
97
105
  this.debounceInputFunction = debounce(value => {
@@ -44,7 +44,7 @@
44
44
  small
45
45
  angular
46
46
  :has="{reset: !!modelToEdit.id}"
47
- @save="$emit('save', modelToEdit, ignoreChangesOnClose)"
47
+ @save="$emit('save', modelToEdit, ignoreChangesOnClose, close)"
48
48
  @reset="$refs.form.reset()"
49
49
  />
50
50
  </a-row>
@@ -68,6 +68,10 @@ export default class EditModal extends Vue {
68
68
  ignoreChangesOnClose_ = false
69
69
 
70
70
  created () {
71
+ if (!this.model && !this.createModelToEdit) {
72
+ console.warn('You need to pass either a model or a model factory to <edit-modal>.')
73
+ }
74
+
71
75
  if (this.show) { // open on create with v-show
72
76
  this.open()
73
77
  }
@@ -50,6 +50,9 @@
50
50
  <div>
51
51
  <div class="accountName">
52
52
  {{ account.first_name }}
53
+ <template v-if="$auth.roles()[0]">
54
+ ({{ $auth.roles()[0].title }})
55
+ </template>
53
56
  </div>
54
57
 
55
58
  <div class="body-2 d-flex align-center">
@@ -10,6 +10,8 @@ class AuthPlugin {
10
10
 
11
11
  hasRole: name => authService.currentAccountHasRole(name),
12
12
 
13
+ roles: () => authService.getCurrentAccountRoles(),
14
+
13
15
  logout: () => authService.forwardToLogoutEndpoint()
14
16
  }
15
17