@afeefa/vue-app 0.0.248 → 0.0.250

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.248
1
+ 0.0.250
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.248",
3
+ "version": "0.0.250",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -32,6 +32,16 @@
32
32
  gap-2
33
33
  justify-end
34
34
  >
35
+ <v-btn
36
+ ref="deleteButton"
37
+ v-if="deleteButton && modelToEdit.id"
38
+ small
39
+ color="error"
40
+ @click="handleDelete"
41
+ >
42
+ Löschen
43
+ </v-btn>
44
+
35
45
  <v-btn
36
46
  small
37
47
  @click="close"
@@ -62,7 +72,7 @@ import { Component, Vue, Watch } from '@a-vue'
62
72
  import { DialogEvent } from '@a-vue/events'
63
73
 
64
74
  @Component({
65
- props: ['model', 'createModelToEdit', 'show', {reset: true, valid: true, forceChanged: false, forceActive: false}]
75
+ props: ['model', 'createModelToEdit', 'show', {deleteButton: false, reset: true, valid: true, forceChanged: false, forceActive: false}]
66
76
  })
67
77
  export default class EditModal extends Vue {
68
78
  show_ = false
@@ -137,6 +147,19 @@ export default class EditModal extends Vue {
137
147
  this.show_ = false
138
148
  }
139
149
 
150
+ async handleDelete () {
151
+ const result = await this.$events.dispatch(new DialogEvent(DialogEvent.SHOW, {
152
+ anchor: this.$refs.form,
153
+ title: 'Löschen bestätigen',
154
+ message: 'Soll dieser Eintrag wirklich gelöscht werden?',
155
+ yesButton: 'Löschen'
156
+ }))
157
+ if (result === DialogEvent.RESULT_YES) {
158
+ this.$emit('delete', this.ignoreChangesOnClose, this.close)
159
+ this.show_ = false
160
+ }
161
+ }
162
+
140
163
  /**
141
164
  * hook to allow to leave a just created (saved) model
142
165
  */
@@ -61,8 +61,8 @@
61
61
 
62
62
  <a-icon-button
63
63
  v-if="buttonCreate"
64
- small
65
- class="mt-4"
64
+ :class="buttonSize === 'small' ? 'mt-4' : 'mt-2'"
65
+ :x-small="buttonSize === 'x-small'"
66
66
  icon="$plusIcon"
67
67
  :text="label"
68
68
  @click="showForm = true"
@@ -86,7 +86,8 @@ import { Component, Vue } from '@a-vue'
86
86
  buttonEdit: false,
87
87
  buttonAdd: false,
88
88
  buttonCreate: false,
89
- modalWidth: 'auto'
89
+ modalWidth: 'auto',
90
+ buttonSize: 'small'
90
91
  }
91
92
  ]
92
93
  })