@afeefa/vue-app 0.0.261 → 0.0.263

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.263
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.263",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -229,7 +229,8 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin, UsesPositio
229
229
  // take given date string an create a local time date object
230
230
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
231
231
  // > When the time zone offset is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as local time.
232
- const dateStringThatGetsConvertedToLocalDate = date + 'T00:00'
232
+ const timeString = this.value_ ? this.value_.toTimeString().split(' ')[0] : '00:00:00'
233
+ const dateStringThatGetsConvertedToLocalDate = date + 'T' + timeString
233
234
  this.value_ = new Date(dateStringThatGetsConvertedToLocalDate)
234
235
  } else {
235
236
  this.value_ = null
@@ -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>
@@ -79,7 +79,7 @@
79
79
 
80
80
 
81
81
  <script>
82
- import { Component, Mixins } from '@a-vue'
82
+ import { Component, Mixins, Watch } from '@a-vue'
83
83
  import { ListFilterMixin } from '../ListFilterMixin'
84
84
  import { ListAction, GetAction } from '@a-vue/api-resources/ApiActions'
85
85
  import { Category } from '@/models'
@@ -97,8 +97,18 @@ export default class ListFilterSearchSelect extends Mixins(ListFilterMixin) {
97
97
 
98
98
  items = []
99
99
  inputModel = 'Alle'
100
+ filterChangedFromInside = false
100
101
 
101
102
  async created () {
103
+ this.onFilterValueChanged()
104
+ }
105
+
106
+ @Watch('filter.value')
107
+ async onFilterValueChanged () {
108
+ if (this.filterChangedFromInside) {
109
+ return
110
+ }
111
+
102
112
  if (this.filter.value) {
103
113
  const model = await this.createGetAction()
104
114
  .params({
@@ -164,12 +174,19 @@ export default class ListFilterSearchSelect extends Mixins(ListFilterMixin) {
164
174
  }
165
175
 
166
176
  itemSelected (model) {
177
+ this.filterChangedFromInside = true
178
+
167
179
  if (model) {
168
180
  this.filter.value = model.id
169
181
  this.inputModel = model.getTitle()
170
182
  } else {
171
183
  this.filter.value = null
172
184
  }
185
+
186
+ this.$nextTick(() => {
187
+ this.filterChangedFromInside = false
188
+ })
189
+
173
190
  this.$emit('select', model)
174
191
  }
175
192
 
@@ -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
  }