@afeefa/vue-app 0.0.223 → 0.0.225

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.223
1
+ 0.0.225
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.223",
3
+ "version": "0.0.225",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -74,10 +74,10 @@
74
74
  <script>
75
75
  import { Component, Mixins } from '@a-vue'
76
76
  import { ListFilterMixin } from '../ListFilterMixin'
77
- import { ListAction } from '@a-vue/api-resources/ApiActions'
77
+ import { ListAction, GetAction } from '@a-vue/api-resources/ApiActions'
78
78
 
79
79
  @Component({
80
- props: ['itemTitle', 'itemValue']
80
+ props: ['itemTitle', 'itemValue', {selectedKey: 'id'}]
81
81
  })
82
82
  export default class ListFilterSearchSelect extends Mixins(ListFilterMixin) {
83
83
  $hasOptions = ['icon']
@@ -87,19 +87,17 @@ export default class ListFilterSearchSelect extends Mixins(ListFilterMixin) {
87
87
 
88
88
  async created () {
89
89
  if (this.filter.value) {
90
- const {models} = await this.createListAction()
90
+ const model = await this.createGetAction()
91
91
  .params({
92
- [this.filter.name]: this.filter.value
92
+ [this.selectedKey]: this.filter.value
93
93
  })
94
94
  .load()
95
95
 
96
- if (models.length) {
96
+ if (model) {
97
97
  if (this.filter.value) {
98
- const selectedModel = models.find(m => m.id === this.filter.value)
98
+ const selectedModel = model
99
99
  if (selectedModel) {
100
100
  this.inputModel = selectedModel.getTitle()
101
- } else {
102
- this.inputModel = models[0].getTitle()
103
101
  }
104
102
  }
105
103
  }
@@ -126,6 +124,20 @@ export default class ListFilterSearchSelect extends Mixins(ListFilterMixin) {
126
124
  return ListAction.fromRequest(request)
127
125
  }
128
126
 
127
+ createGetAction () {
128
+ const request = this.filter
129
+ .createOptionsRequest('get')
130
+
131
+ const getAction = this.$apiResources.getAction({
132
+ resourceType: request.getAction().getResource().getType(),
133
+ actionName: 'get'
134
+ })
135
+
136
+ request.action(getAction)
137
+
138
+ return GetAction.fromRequest(request)
139
+ }
140
+
129
141
  itemSelected (model) {
130
142
  if (model) {
131
143
  this.filter.value = model.id
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="listColumnHeader">
3
3
  <div
4
- :class="['content', {order}]"
4
+ :class="['content', {order, right}]"
5
5
  @click="toggleSort"
6
6
  >
7
7
  <div
@@ -42,7 +42,7 @@
42
42
  import { Component, Vue } from '@a-vue'
43
43
 
44
44
  @Component({
45
- props: ['text', 'icon', 'order']
45
+ props: ['text', 'icon', 'order', {right: false}]
46
46
  })
47
47
  export default class ListColumnHeader extends Vue {
48
48
  get orderValue () {
@@ -110,6 +110,10 @@ export default class ListColumnHeader extends Vue {
110
110
  user-select: none;
111
111
  cursor: pointer;
112
112
  }
113
+
114
+ &.right {
115
+ justify-content: end;
116
+ }
113
117
  }
114
118
 
115
119
  :deep(.v-icon) {