@afeefa/vue-app 0.0.297 → 0.0.298

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.297
1
+ 0.0.298
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.297",
3
+ "version": "0.0.298",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -18,6 +18,7 @@ import NestedEditForm from './form/NestedEditForm'
18
18
  import ListFilterDate from './list/filters/ListFilterDate'
19
19
  import ListFilterPage from './list/filters/ListFilterPage'
20
20
  import ListFilterSearch from './list/filters/ListFilterSearch'
21
+ import ListFilterSearch2 from './list/filters/ListFilterSearch2'
21
22
  import ListFilterSearchSelect from './list/filters/ListFilterSearchSelect'
22
23
  import ListFilterSelect from './list/filters/ListFilterSelect'
23
24
 
@@ -38,6 +39,7 @@ Vue.component('FormFieldSelect', FormFieldSelect)
38
39
  Vue.component('FormFieldSelect2', FormFieldSelect2)
39
40
  Vue.component('ListFilterPage', ListFilterPage)
40
41
  Vue.component('ListFilterSearch', ListFilterSearch)
42
+ Vue.component('ListFilterSearch2', ListFilterSearch2)
41
43
  Vue.component('ListFilterSelect', ListFilterSelect)
42
44
  Vue.component('ListFilterSearchSelect', ListFilterSearchSelect)
43
45
  Vue.component('ListFilterDate', ListFilterDate)
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <a-row gap="4">
3
+ <a-text-field
4
+ ref="input"
5
+ v-model="filter.value"
6
+ :maxWidth="$attrs.maxWidth || maxWidth_"
7
+ :label="label_"
8
+ :debounce="500"
9
+ v-bind="$attrs"
10
+ clearable
11
+ hide-details
12
+ @keyup.esc="clearValue"
13
+ v-on="$listeners"
14
+ />
15
+
16
+ <a-radio-group
17
+ v-model="filters.qfield.value"
18
+ :options="qFieldOptions"
19
+ row
20
+ hide-details
21
+ />
22
+ </a-row>
23
+ </template>
24
+
25
+
26
+ <script>
27
+ import { Component, Mixins } from '@a-vue'
28
+ import { ListFilterMixin } from '../ListFilterMixin'
29
+
30
+ @Component
31
+ export default class ListFilterSearch2 extends Mixins(ListFilterMixin) {
32
+ name_ = 'q'
33
+ maxWidth_ = 200
34
+
35
+ clearValue (e) {
36
+ if (this.filter.value) {
37
+ e.stopPropagation()
38
+ this.filter.value = null
39
+ }
40
+ }
41
+
42
+ setFocus (force) {
43
+ this.$refs.input.setFocus(force)
44
+ }
45
+
46
+ hasQFieldOptions () {
47
+ return this.filters.qfield && this.filters.qfield.hasOptions()
48
+ }
49
+
50
+ get qFieldOptions () {
51
+ return this.filters.qfield.options.map(o => ({
52
+ ...o,
53
+ itemText: o.title,
54
+ itemValue: o.value
55
+ }))
56
+ }
57
+
58
+ get label_ () {
59
+ const label = this.label || 'Suche'
60
+
61
+ if (this.hasQFieldOptions() && !this.filters.qfield.hasDefaultValueSet()) {
62
+ const selected = this.qFieldOptions.filter(o => o.value === this.filters.qfield.value)[0]
63
+ if (selected) {
64
+ return `${label} (${selected.title})`
65
+ }
66
+ }
67
+
68
+ return label
69
+ }
70
+ }
71
+ </script>
72
+
73
+
74
+ <style lang="scss" scoped>
75
+ ::v-deep() {
76
+ .v-radio {
77
+ margin-right: 14px !important;
78
+ margin-top: -4px;
79
+ }
80
+
81
+ .v-input--selection-controls__input {
82
+ margin-right: 3px;
83
+ }
84
+ }
85
+ </style>