@afeefa/vue-app 0.0.261 → 0.0.262

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.261
1
+ 0.0.262
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.261",
3
+ "version": "0.0.262",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -33,11 +33,11 @@
33
33
  justify-end
34
34
  >
35
35
  <v-btn
36
- ref="deleteButton"
37
36
  v-if="deleteButton && modelToEdit.id"
37
+ ref="deleteButton"
38
38
  small
39
39
  color="error"
40
- @click="handleDelete"
40
+ @click="handleDelete(modelToEdit)"
41
41
  >
42
42
  Löschen
43
43
  </v-btn>
@@ -148,7 +148,7 @@ export default class EditModal extends Vue {
148
148
  this.show_ = false
149
149
  }
150
150
 
151
- async handleDelete () {
151
+ async handleDelete (modelToEdit) {
152
152
  const result = await this.$events.dispatch(new DialogEvent(DialogEvent.SHOW, {
153
153
  anchor: this.$refs.form,
154
154
  title: 'Löschen bestätigen',
@@ -156,7 +156,7 @@ export default class EditModal extends Vue {
156
156
  yesButton: 'Löschen'
157
157
  }))
158
158
  if (result === DialogEvent.RESULT_YES) {
159
- this.$emit('delete', this.ignoreChangesOnClose, this.close)
159
+ this.$emit('delete', modelToEdit, this.ignoreChangesOnClose, this.close)
160
160
  this.show_ = false
161
161
  }
162
162
  }
@@ -6,7 +6,11 @@
6
6
  :validator="validator"
7
7
  v-bind="$attrs"
8
8
  v-on="$listeners"
9
- />
9
+ >
10
+ <template #append>
11
+ <slot name="append" />
12
+ </template>
13
+ </a-text-field>
10
14
  </template>
11
15
 
12
16
  <script>
@@ -1,5 +1,5 @@
1
- export function formatEuroPrice (price) {
2
- if (!price) {
1
+ export function formatEuroPrice (price, showZero = false) {
2
+ if (!price && !showZero) {
3
3
  return ''
4
4
  }
5
5
 
@@ -32,6 +32,8 @@
32
32
  :createModelToEdit="createModelToEdit"
33
33
  :title="label"
34
34
  :icon="icon"
35
+ :deleteButton="deleteButton"
36
+ @delete="deleteModel"
35
37
  @save="save"
36
38
  @close="close"
37
39
  >
@@ -86,6 +88,7 @@ import { Component, Vue } from '@a-vue'
86
88
  buttonEdit: false,
87
89
  buttonAdd: false,
88
90
  buttonCreate: false,
91
+ deleteButton: false,
89
92
  modalWidth: 'auto',
90
93
  buttonSize: 'small'
91
94
  }
@@ -98,6 +101,10 @@ export default class EditableDetailProperty extends Vue {
98
101
  this.$emit('save', {model, ignoreChangesOnClose, closeModal})
99
102
  }
100
103
 
104
+ deleteModel (model, ignoreChangesOnClose, closeModal) {
105
+ this.$emit('delete', {model, ignoreChangesOnClose, closeModal})
106
+ }
107
+
101
108
  openModal () {
102
109
  this.showForm = true
103
110
  }