@afeefa/vue-app 0.0.295 → 0.0.296

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.295
1
+ 0.0.296
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.295",
3
+ "version": "0.0.296",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  import { Component, Vue } from '@a-vue'
2
2
 
3
3
  @Component({
4
- props: ['name', 'label']
4
+ props: ['name', 'label', 'optionRequestParams']
5
5
  })
6
6
  export class ListFilterMixin extends Vue {
7
7
  name_ = null
@@ -31,11 +31,7 @@ export default class ListFilterSelect extends Mixins(ListFilterMixin) {
31
31
  this.filter.value = []
32
32
  }
33
33
 
34
- if (this.filter.hasOptionsRequest()) {
35
- this.items = this.loadRequestOptions()
36
- } else if (this.filter.hasOptions()) {
37
- this.items = this.getOptions()
38
- }
34
+ this.reloadOptions()
39
35
  }
40
36
 
41
37
  get clearable () {
@@ -56,7 +52,11 @@ export default class ListFilterSelect extends Mixins(ListFilterMixin) {
56
52
 
57
53
  async loadRequestOptions () {
58
54
  const {models} = await ListAction
59
- .fromRequest(this.filter.createOptionsRequest())
55
+ .fromRequest(
56
+ this.filter
57
+ .createOptionsRequest()
58
+ .addParams(this.optionRequestParams || {})
59
+ )
60
60
  .load()
61
61
 
62
62
  this.$emit('optionsLoaded', models)
@@ -93,5 +93,13 @@ export default class ListFilterSelect extends Mixins(ListFilterMixin) {
93
93
  })
94
94
  ]
95
95
  }
96
+
97
+ reloadOptions () {
98
+ if (this.filter.hasOptionsRequest()) {
99
+ this.items = this.loadRequestOptions()
100
+ } else if (this.filter.hasOptions()) {
101
+ this.items = this.getOptions()
102
+ }
103
+ }
96
104
  }
97
105
  </script>