@afeefa/vue-app 0.0.346 → 0.0.348

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.346
1
+ 0.0.348
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.346",
3
+ "version": "0.0.348",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -89,6 +89,11 @@ export default class AContextMenu extends Mixins(UsesPositionServiceMixin, Cance
89
89
  }
90
90
 
91
91
  open () {
92
+ if (this.isOpen) {
93
+ this.close()
94
+ return
95
+ }
96
+
92
97
  window.addEventListener('mousedown', this.onClickOutside)
93
98
  window.addEventListener('wheel', this.close)
94
99
  window.addEventListener('touchmove', this.close)
@@ -16,7 +16,7 @@
16
16
  </template>
17
17
 
18
18
  <script>
19
- import { Component, Mixins } from '@a-vue'
19
+ import { Component, Mixins, Watch } from '@a-vue'
20
20
  import { FormFieldMixin } from '../FormFieldMixin'
21
21
 
22
22
  @Component
@@ -27,10 +27,19 @@ export default class FormFieldSelect extends Mixins(FormFieldMixin) {
27
27
  this.reloadOptions()
28
28
  }
29
29
 
30
+ // Beim Recycling der Komponente (z.B. ein v-if-Block mit Select wird durch
31
+ // einen anderen v-if-Block mit Select an gleicher Position ersetzt) läuft
32
+ // created() nicht erneut. Ändert sich dabei das angebundene Feld (name) oder
33
+ // dessen optionRequestParams, müssen die Options neu geladen werden – sonst
34
+ // zeigt das Select die Optionen des vorherigen Felds.
35
+ @Watch('name')
36
+ @Watch('optionRequestParams')
37
+ onFieldChanged () {
38
+ this.reloadOptions()
39
+ }
40
+
30
41
  reloadOptions () {
31
- if (this.fieldHasOptionsRequest()) {
32
- this.items = this.getSelectOptions()
33
- } else if (this.fieldHasOptions()) {
42
+ if (this.fieldHasOptionsRequest() || this.fieldHasOptions()) {
34
43
  this.items = this.getSelectOptions()
35
44
  }
36
45
  }
@@ -1,4 +1,4 @@
1
- export function formatEuroPrice (price, showZero = false) {
1
+ export function formatEuroPrice (price, showZero = true) {
2
2
  if (!price && !showZero) {
3
3
  return ''
4
4
  }
@@ -8,6 +8,5 @@ export function formatEuroPrice (price, showZero = false) {
8
8
  currency: 'EUR'
9
9
  })
10
10
 
11
- return formatter.format(price)
11
+ return formatter.format(price ?? 0)
12
12
  }
13
-