@afeefa/vue-app 0.0.57 → 0.0.58

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.57
1
+ 0.0.58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@ import { ListFilterMixin } from '../ListFilterMixin'
18
18
  import { ListAction } from '@a-vue/api-resources/ApiActions'
19
19
 
20
20
  @Component({
21
- props: ['itemTitle']
21
+ props: ['itemTitle', 'itemValue']
22
22
  })
23
23
  export default class ListFilterSelect extends Mixins(ListFilterMixin) {
24
24
  items = null
@@ -62,10 +62,20 @@ export default class ListFilterSelect extends Mixins(ListFilterMixin) {
62
62
 
63
63
  return [
64
64
  ...this.createOptions(),
65
- ...models.map(model => ({
66
- itemTitle: (this.itemTitle && this.itemTitle(model)) || model.name || model.title,
67
- itemValue: model.id
68
- }))
65
+ ...models.map(model => {
66
+ let itemValue
67
+ if (this.itemValue) {
68
+ itemValue = this.itemValue(model)
69
+ } else if (model.value !== undefined) {
70
+ itemValue = model.value
71
+ } else {
72
+ itemValue = model.id
73
+ }
74
+ return {
75
+ itemTitle: (this.itemTitle && this.itemTitle(model)) || model.name || model.title,
76
+ itemValue
77
+ }
78
+ })
69
79
  ]
70
80
  }
71
81